Merge request search has a high number of database calls
Summary
There is a high number of calls to the database when loading merge request search results.
Steps to reproduce
- enable the performance bar
- perform a global merge request search: ## Summary
There is a high number of calls to the database when loading project search results.
Steps to reproduce
- enable the performance bar
- perform a global project search: https://gitlab.com/search?scope=projects&search=test
- for the search I performed, there were 153 postgres calls
What is the current bug behavior?
There are some (undetected) N+1 calls for merge requests search results
Possible fixes
- Web UI preloads from
SearchControllerare usingwith_web_entity_associationsfrom the merge request model - merge request view is rendered using HAML:
app/views/search/results/_merge_request.html.haml - N+1 specs are likely missing data setup (for whatever data is causing the excessive queries):
Edited by Terri Chu
