Grapqhl query to get board list issues is slow
This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.
Reproducer:
- go to Portfolio Management and certify board
- open web developer console in your browser
- select "group by: Epic" (supposing swimlanes are still enabled for gitlab-org)
- in network tab you can see 2 graphql queries - first one (getting board epics) is served in a reasonable time, the second request takes about 30s.
The second request loads board list issues, here is profiler output of the query: out.profile. From a brief check there might be couple of problems:
- the query to get paginated issues is slow (about 7s)
- there is an N+1 query issue (2300 SQL queries are done during the request) - it would be good to try to eliminate some of them if possible
Related to #229143 (closed)
UPDATE: originally this issue aimed optimization of loading issues when epic swimlanes are loaded (loading of swimlanes used to perform well), but now the major/primary bottleneck is slow query when loading swimlanes itself. So primary focus should be optimizing loading of swimlanes (this may be improved by removing expensive ordering from the query - #243606 (comment 680609188))