Skip to content

Exclude project namespaces from autocomplete routes finder

Jan Provaznik requested to merge jprovazn-exclude2 into master

What does this MR do and why?

Excludes project namespaces from group autocomplete routes finder.

Related to #341823 (closed)

DB query

warm cache: https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/7022/commands/24860

SELECT "routes".* FROM "routes" WHERE "routes"."source_type" = 'Namespace' AND "routes"."source_id" IN (SELECT "namespaces"."id" FROM "namespaces" WHERE (type IS DISTINCT FROM 'Project')) AND "routes"."path" ILIKE '%gitlab%' ORDER BY LENGTH(routes.path), "routes"."path" ASC LIMIT 20

Time: 2.493 s  
  - planning: 1.819 ms  
  - execution: 2.492 s  
    - I/O read: 947.860 ms  
    - I/O write: 0.000 ms  
  
Shared buffers:  
  - hits: 188038 (~1.40 GiB) from the buffer pool  
  - reads: 27249 (~212.90 MiB) from the OS file cache, including disk I/O  
  - dirtied: 0  
  - writes: 0  

This seems to be slow, though the old query is slow too (warm cache): https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/7022/commands/24858

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Jan Provaznik

Merge request reports