Skip to content

Fix timeouts in group autocomplete query

Heinrich Lee Yu requested to merge 482866-improve-query-groups-autocomplete into master

What does this MR do and why?

When fix_user_authorized_groups is enabled, the autocomplete query can result in a bad query plan where PG does an index scan on the routes table.

We fix this by wrapping the groups in a materialized CTE which then gets filtered by the route pattern.

Queries

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #482866 (closed)

Edited by Heinrich Lee Yu

Merge request reports

Loading