Merge branch 'fix-502-mrs-with-lots-of-versions' into 'master'
Fix another timeout when searching for pipelines
Closes #39054
See merge request gitlab-org/gitlab-ce!15322
(cherry picked from commit 0517b9e3)
ec73ecb0 Fix another timeout when searching for pipelines