Skip to content

fix #34510 add association preloading for issue boards

Micael Bergeron requested to merge 34510-board-issues-sql-speedup into master

What does this MR do?

This should help to lower the average process time for the Boards::IssuesController#index There were 4 cases of N+1 queries that made a substantial increase in the query count.

I also removed an unused serialized field (user)

Are there points in the code the reviewer needs to double check?

I thought of using Note scopes, namely inc_relations_for_view but couldn't get it to work with #preload. If there is a better way than explicitly name each relation let me know.

Why was this MR needed?

The specified endpoint was slow, and part of the reason was high SQL timings.

Screenshots (if relevant)

Before 16-26-47

After 16-26-33

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #34510 (closed)

Edited by Micael Bergeron

Merge request reports