Skip to content

Add a flag to use a subquery for group issues search

Sean McGivern requested to merge move-group-issues-search-cte-up-the-chain into master

What does this MR do?

For full history, see the follow-up issue https://gitlab.com/gitlab-org/gitlab-ce/issues/54643.

We already had a flag to use a CTE, but this broke searching in some cases where we need to sort by a joined table. Disabling the CTE flag makes searches much slower.

The new flag, to use a subquery, makes them slightly slower than the CTE, while maintaining correctness. If both it and the CTE flag are enabled, the subquery takes precedence.

Test results: https://gitlab.com/gitlab-org/gitlab-ce/snippets/1785488

Note that the group issues query is slightly slower after: this is hopefully acceptable given the above.

Does this MR meet the acceptance criteria?

Merge request reports