Improve performance of `User#authorized_groups` query
Created from !150971 (comment 1940808653) and !153205 (comment 1911495790):
The User#authorized_groups
query can consume a lot of buffers.
Sample query: https://postgres.ai/console/gitlab/gitlab-production-main/sessions/28812/commands/89915
This query is used to find groups the user has access to. This is used in rendering the groups list (/dashboard/groups
) and also in the @
autocomplete.
Edited by Heinrich Lee Yu