Merge branch 'bvl-fix-count-with-selects' into 'master'
Remove the selects when counting the last page
Closes #40266
See merge request gitlab-org/gitlab-ce!15456
(cherry picked from commit c406824d)
5a335c4d Remove the selects when counting the last page