summaryrefslogtreecommitdiff
path: root/changelogs
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2018-06-05 18:31:32 +0100
committerSean McGivern <sean@gitlab.com>2018-06-07 10:23:09 +0100
commitc03386c3914feca56802e6f99bbd0fd08d269472 (patch)
treed33862172947601b914b71c91ee35113d75c7ec0 /changelogs
parent57e6a98ce41363150d24b96ee53c748189b936b4 (diff)
downloadgitlab-ce-c03386c3914feca56802e6f99bbd0fd08d269472.tar.gz
Force Postgres to avoid trigram indexes when in a group
When filtering issues with a search string in a group, we observed on GitLab.com that Postgres was using an inefficient query plan, preferring the (global) trigram indexes on description and title, rather than using a filter on the restricted set of issues within the group. Change the callers of the IssuableFinder to use a CTE in this case to fence the rest of the query from the LIKE filters, so that the optimiser is forced to perform the filter in the order we prefer. This will only force the use of a CTE when: 1. The use_cte_for_search params is truthy. 2. We are using Postgres. 3. We have passed the `search` param. The third item is important - searching issues using the search box does not use the finder in this way, but contructs a query and appends `full_search` to that. For some reason, this query does not suffer from the same issue. Currenly, we only pass this param when filtering issuables (issues or MRs) in a group context.
Diffstat (limited to 'changelogs')
-rw-r--r--changelogs/unreleased/46648-timeout-searching-group-issues.yml5
1 files changed, 5 insertions, 0 deletions
diff --git a/changelogs/unreleased/46648-timeout-searching-group-issues.yml b/changelogs/unreleased/46648-timeout-searching-group-issues.yml
new file mode 100644
index 00000000000..54401edf5cc
--- /dev/null
+++ b/changelogs/unreleased/46648-timeout-searching-group-issues.yml
@@ -0,0 +1,5 @@
+---
+title: Improve performance of group issues filtering on GitLab.com
+merge_request: 19429
+author:
+type: performance