Remove N+1 queries from users autocomplete

Both of these were related to groups:

1. We need to preload routes (using the `with_route` scope) if we're
   going to get the group's path.
2. We were counting each group's members separately.

They're in the same commit because the spec for N+1 detection wouldn't
pass with only one of these fixes.
146 jobs for <span class="ref-name">fix-routes-n-plus-one-in-user-autocomplete</span> in 55 minutes (queued for 11 seconds)
Status Job ID Name Coverage
  Build
manual #183571826
gitlab-org allowed to fail manual
review-docs-deploy-manual
 
  Prepare
passed #183571835
gitlab-org docker
build-qa-image

00:04:32

passed #183571832
gitlab-org
compile-assets

00:06:38

passed #183571831
gitlab-org
retrieve-tests-metadata

00:00:31

passed #183571833
gitlab-org
setup-test-env

00:04:37

 
  Test
passed #183571837
allowed to fail
code_quality

00:11:46

passed #183571841
danger-review

00:02:54

passed #183571995
gitlab-org
db:check-schema-pg

00:01:46

passed #183571994
gitlab-org
db:migrate:reset-mysql

00:03:42

passed #183571993
gitlab-org
db:migrate:reset-pg

00:03:12

passed #183572003
gitlab-org
db:rollback-mysql

00:05:54

passed #183572002
gitlab-org
db:rollback-pg

00:02:33

passed #183572010
allowed to fail
dependency_scanning

00:04:29

passed #183571990
gitlab-org
docs lint

00:02:20

passed #183571991
gitlab-org
downtime_check

00:01:44

passed #183571992
gitlab-org
ee_compat_check

00:02:56

passed #183572006
docker gitlab-org
gitlab:assets:compile

00:12:00

passed #183572005
gitlab-org
gitlab:setup-mysql

00:05:22

passed #183572004
gitlab-org
gitlab:setup-pg

00:04:16

passed #183572016
gitlab-org
gitlab_git_test

00:02:25

passed #183572008
gitlab-org
jest

00:09:34

passed #183572007
gitlab-org
karma

00:10:13

58.74%
passed #183571999
gitlab-org
migration:path-mysql

00:13:24

passed #183571997
gitlab-org
migration:path-pg

00:10:26

passed #183572017
gitlab-org
no_ee_check

00:00:33

manual #183571839
allowed to fail manual
package-and-qa
passed #183572014
gitlab-org
qa-frontend-node:10

00:07:56

passed #183572013
gitlab-org
qa-frontend-node:8

00:07:44

passed #183572015
gitlab-org allowed to fail
qa-frontend-node:latest

00:07:48

passed #183572011
gitlab-org
qa:internal

00:02:43

passed #183572012
gitlab-org
qa:selectors

00:02:37

passed #183572019
review-build-cng

00:31:40

passed #183572021
gitlab-org allowed to fail
review-deploy

00:38:08

passed #183572029
gitlab-org docker allowed to fail
review-performance

00:38:42

manual #183572026
gitlab-org docker allowed to fail manual
review-qa-all
passed #183572024
gitlab-org docker allowed to fail
review-qa-smoke

00:44:30

manual #183572030
gitlab-org allowed to fail manual
review-stop
passed #183571918
gitlab-org
rspec-mysql 1/50

00:12:16

passed #183571928
gitlab-org
rspec-mysql 10/50

00:23:26

passed #183571929
gitlab-org
rspec-mysql 11/50

00:19:52

passed #183571930
gitlab-org
rspec-mysql 12/50

00:15:34

passed #183571931
gitlab-org
rspec-mysql 13/50

00:20:27

passed #183571932
gitlab-org
rspec-mysql 14/50

00:19:44

passed #183571933
gitlab-org
rspec-mysql 15/50

00:14:52

passed #183571934
gitlab-org
rspec-mysql 16/50

00:15:31

passed #183571935
gitlab-org
rspec-mysql 17/50

00:23:55

passed #183571937
gitlab-org
rspec-mysql 18/50

00:19:02

passed #183571939
gitlab-org
rspec-mysql 19/50

00:20:55

passed #183571919
gitlab-org
rspec-mysql 2/50

00:19:38

passed #183571940
gitlab-org
rspec-mysql 20/50

00:20:43

passed #183571941
gitlab-org
rspec-mysql 21/50

00:14:04

passed #183571942
gitlab-org
rspec-mysql 22/50

00:18:22

passed #183571943
gitlab-org
rspec-mysql 23/50

00:20:41

passed #183571948
gitlab-org
rspec-mysql 24/50

00:16:23

passed #183571949
gitlab-org
rspec-mysql 25/50

00:19:59

passed #183571950
gitlab-org
rspec-mysql 26/50

00:19:47

passed #183571951
gitlab-org
rspec-mysql 27/50

00:14:49

passed #183571952
gitlab-org
rspec-mysql 28/50

00:16:05

passed #183571954
gitlab-org
rspec-mysql 29/50

00:15:13

passed #183571920
gitlab-org
rspec-mysql 3/50

00:12:05

passed #183571957
gitlab-org
rspec-mysql 30/50

00:18:04

passed #183571961
gitlab-org
rspec-mysql 31/50

00:19:19

passed #183571962
gitlab-org
rspec-mysql 32/50

00:18:26

passed #183571963
gitlab-org
rspec-mysql 33/50

00:18:24

passed #183571964
gitlab-org
rspec-mysql 34/50

00:15:24

passed #183571965
gitlab-org
rspec-mysql 35/50

00:19:30

passed #183571966
gitlab-org
rspec-mysql 36/50

00:15:04

passed #183571967
gitlab-org
rspec-mysql 37/50

00:18:48

passed #183571968
gitlab-org
rspec-mysql 38/50

00:16:16

passed #183571971
gitlab-org
rspec-mysql 39/50

00:20:23

passed #183571921
gitlab-org
rspec-mysql 4/50

00:12:29

passed #183571973
gitlab-org
rspec-mysql 40/50

00:14:25

passed #183571975
gitlab-org
rspec-mysql 41/50

00:19:42

passed #183571976
gitlab-org
rspec-mysql 42/50

00:15:29

passed #183571977
gitlab-org
rspec-mysql 43/50

00:18:43

passed #183571978
gitlab-org
rspec-mysql 44/50

00:17:03

passed #183571979
gitlab-org
rspec-mysql 45/50

00:22:03

passed #183571980
gitlab-org
rspec-mysql 46/50

00:19:27

passed #183571981
gitlab-org
rspec-mysql 47/50

00:18:39

passed #183571982
gitlab-org
rspec-mysql 48/50

00:14:53

passed #183571985
gitlab-org
rspec-mysql 49/50

00:18:24

passed #183571922
gitlab-org
rspec-mysql 5/50

00:20:22

passed #183571986
gitlab-org
rspec-mysql 50/50

00:22:26

passed #183571923
gitlab-org
rspec-mysql 6/50

00:19:50

passed #183571924
gitlab-org
rspec-mysql 7/50

00:20:38

passed #183571925
gitlab-org
rspec-mysql 8/50

00:18:59

passed #183571926
gitlab-org
rspec-mysql 9/50

00:13:52

passed #183571988
gitlab-org allowed to fail
rspec-mysql-quarantine

00:07:59

passed #183571843
gitlab-org
rspec-pg 1/50

00:12:50

passed #183571855
gitlab-org
rspec-pg 10/50

00:19:23

passed #183571856
gitlab-org
rspec-pg 11/50

00:15:19

passed #183571857
gitlab-org
rspec-pg 12/50

00:12:24

passed #183571858
gitlab-org
rspec-pg 13/50

00:19:04

passed #183571859
gitlab-org
rspec-pg 14/50

00:19:09

passed #183571860
gitlab-org
rspec-pg 15/50

00:19:15

passed #183571861
gitlab-org
rspec-pg 16/50

00:14:22

passed #183571862
gitlab-org
rspec-pg 17/50

00:19:20

passed #183571863
gitlab-org
rspec-pg 18/50

00:19:14

passed #183571864
gitlab-org
rspec-pg 19/50

00:12:37

passed #183571844
gitlab-org
rspec-pg 2/50

00:19:35

passed #183571865
gitlab-org
rspec-pg 20/50

00:18:09

passed #183571866
gitlab-org
rspec-pg 21/50

00:16:21

passed #183571869
gitlab-org
rspec-pg 22/50

00:19:43

passed #183571870
gitlab-org
rspec-pg 23/50

00:19:55

passed #183571872
gitlab-org
rspec-pg 24/50

00:14:14

passed #183571873
gitlab-org
rspec-pg 25/50

00:19:03

passed #183571875
gitlab-org
rspec-pg 26/50

00:19:39

passed #183571876
gitlab-org
rspec-pg 27/50

00:15:21

passed #183571878
gitlab-org
rspec-pg 28/50

00:18:45

passed #183571879
gitlab-org
rspec-pg 29/50

00:18:10

passed #183571845
gitlab-org
rspec-pg 3/50

00:11:17

passed #183571882
gitlab-org
rspec-pg 30/50

00:21:21

passed #183571883
gitlab-org
rspec-pg 31/50

00:22:41

passed #183571885
gitlab-org
rspec-pg 32/50

00:22:41

passed #183571887
gitlab-org
rspec-pg 33/50

00:19:52

passed #183571888
gitlab-org
rspec-pg 34/50

00:18:30

passed #183571889
gitlab-org
rspec-pg 35/50

00:21:52

passed #183571890
gitlab-org
rspec-pg 36/50

00:19:30

passed #183571892
gitlab-org
rspec-pg 37/50

00:15:53

passed #183571893
gitlab-org
rspec-pg 38/50

00:21:44

passed #183571894
gitlab-org
rspec-pg 39/50

00:17:01

passed #183571847
gitlab-org
rspec-pg 4/50

00:11:16

passed #183571895
gitlab-org
rspec-pg 40/50

00:22:03

passed #183571897
gitlab-org
rspec-pg 41/50

00:19:37

passed #183571900
gitlab-org
rspec-pg 42/50

00:17:17

passed #183571906
gitlab-org
rspec-pg 43/50

00:19:02

passed #183571908
gitlab-org
rspec-pg 44/50

00:19:30

passed #183571911
gitlab-org
rspec-pg 45/50

00:17:24

passed #183571912
gitlab-org
rspec-pg 46/50

00:19:11

passed #183571914
gitlab-org
rspec-pg 47/50

00:14:42

passed #183571915
gitlab-org
rspec-pg 48/50

00:18:52

passed #183571916
gitlab-org
rspec-pg 49/50

00:19:20

passed #183571849
gitlab-org
rspec-pg 5/50

00:18:19

passed #183571917
gitlab-org
rspec-pg 50/50

00:21:32

passed #183571851
gitlab-org
rspec-pg 6/50

00:14:39

passed #183571852
gitlab-org
rspec-pg 7/50

00:20:46

passed #183571853
gitlab-org
rspec-pg 8/50

00:19:31

passed #183571854
gitlab-org
rspec-pg 9/50

00:19:14

failed #183571987
gitlab-org allowed to fail
rspec-pg-quarantine

00:11:14

passed #183572009
allowed to fail
sast

00:22:13

passed #183571989
gitlab-org
static-analysis

00:14:18

 
  Post Test
passed #183572032
gitlab-org
coverage

00:03:47

95.23%
passed #183572031
gitlab-org allowed to fail
flaky-examples-check

00:02:10

passed #183572034
gitlab-org
jsdoc

00:01:39

passed #183572033
gitlab-org
lint:javascript:report

00:01:37

 
  Post Cleanup
manual #183572035
gitlab-org allowed to fail manual
review-docs-cleanup
 
Name Stage Failure
failed
rspec-pg-quarantine Test
knapsack/: found 3 matching files                  
rspec_flaky/: found 2 matching files
rspec_profiling/: found 1 matching files
tmp/capybara/: found 9 matching files
Uploading artifacts to coordinator... ok id=183571987 responseStatus=201 Created token=iQAC4ZAE
Uploading artifacts...
WARNING: junit_rspec.xml: no matching files
ERROR: No files to upload
ERROR: Job failed: exit code 1