Code search has a high number of database calls

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

There is a high number of calls to the database when loading code search results.

Steps to reproduce

  1. enable the performance bar
  2. make sure Zoekt is not enabled in preferences. I had a hard time getting this to show up due to Zoekt showing 1 result per match (Meaning all of the page results were from the same project so it didn't report such high database calls)
  3. perform a global code search: https://gitlab.com/search?group_id=9970&scope=blobs&search=target_project
  4. for the search I performed, there were 196 postgres calls

image

What is the current bug behavior?

There are some (undetected) N+1 calls for code search results

Possible fixes

Edited by 🤖 GitLab Bot 🤖