Add a trigram index for routes.path
What does this MR do?
Adds a trigram index for routes.path
Are there points in the code the reviewer needs to double check?
Is a MySQL equivalent required?
Is this a reasonable approach to the problem? Do sensible alternatives exist?
Should this be a post-deployment migration? I get the feeling adding this index is going to be slow?
Why was this MR needed?
routes.path
is btree indexed at present, but this only works for LIKE
clauses if the string to compare against is a literal. It cannot be sourced from a column.
Some sites in the GitLab codebase - notably Routable.member_descendents
, Routable.member_self_and_descendants
and Routable.member_hierarchy
, which are used when creating groups, among other things, perform queries that do not meet these requirements.
In these circumstances, adding a trigram improves the performance of these queries significantly.
Fuller analysis, including EXPLAIN charts, can be found in the issue, starting at: https://gitlab.com/gitlab-org/gitlab-ce/issues/31403#note_28297360
Screenshots (if relevant)
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added - Tests
-
Added for this feature/bug -
All builds are passing
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Branch has no merge conflicts with master
(if it does - rebase it please) -
Squashed related commits together
What are the relevant issue numbers?
Closes #31403 (moved)