Skip to content

Add UI control to switch between Zoekt and Elasticsearch

John Mason requested to merge jm-zoekt-ui-controls into master

What does this MR do and why?

Related to #384726 (closed)

Add UI control to switch between Zoekt and Elasticsearch

query plan: https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/19267/commands/63578

Click to expand
 Limit  (cost=17.59..19.14 rows=1 width=4) (actual time=18.948..18.954 rows=0 loops=1)
   Buffers: shared hit=3 read=10
   I/O Timings: read=18.677 write=0.000
   ->  Merge Join  (cost=17.59..20.69 rows=2 width=4) (actual time=18.946..18.952 rows=0 loops=1)
         Merge Cond: (zoekt_indexed_namespaces.namespace_id = namespaces.id)
         Buffers: shared hit=3 read=10
         I/O Timings: read=18.677 write=0.000
         ->  Index Only Scan using index_zoekt_indexed_namespaces_on_namespace_id on public.zoekt_indexed_namespaces  (cost=0.13..3.17 rows=3 width=8) (actual time=2.694..2.695 rows=1 loops=1)
               Heap Fetches: 0
               Buffers: shared read=2
               I/O Timings: read=2.642 write=0.000
         ->  Unique  (cost=17.46..17.47 rows=2 width=4) (actual time=16.248..16.252 rows=0 loops=1)
               Buffers: shared hit=3 read=8
               I/O Timings: read=16.034 write=0.000
               ->  Sort  (cost=17.46..17.46 rows=2 width=4) (actual time=16.247..16.251 rows=0 loops=1)
                     Sort Key: namespaces.id
                     Sort Method: quicksort  Memory: 25kB
                     Buffers: shared hit=3 read=8
                     I/O Timings: read=16.034 write=0.000
                     ->  Append  (cost=0.56..17.45 rows=2 width=4) (actual time=16.180..16.184 rows=0 loops=1)
                           Buffers: shared read=8
                           I/O Timings: read=16.034 write=0.000
                           ->  Index Scan using index_namespaces_on_owner_id on public.namespaces  (cost=0.56..3.58 rows=1 width=4) (actual time=7.523..7.523 rows=0 loops=1)
                                 Index Cond: (namespaces.owner_id = 10)
                                 Filter: ((namespaces.type)::text = 'User'::text)
                                 Rows Removed by Filter: 0
                                 Buffers: shared read=4
                                 I/O Timings: read=7.468 write=0.000
                           ->  Nested Loop  (cost=1.00..13.83 rows=1 width=4) (actual time=8.653..8.655 rows=0 loops=1)
                                 Buffers: shared read=4
                                 I/O Timings: read=8.566 write=0.000
                                 ->  Index Scan using idx_members_on_user_and_source_and_source_type_and_member_role on public.members  (cost=0.56..10.38 rows=1 width=4) (actual time=8.651..8.651 rows=0 loops=1)
                                       Index Cond: ((members.user_id = 10) AND ((members.source_type)::text = 'Namespace'::text))
                                       Filter: ((members.requested_at IS NULL) AND (members.access_level >= 10) AND ((members.type)::text = 'GroupMember'::text) AND (members.access_level = ANY ('{20,30,40,50}'::integer[])))
                                       Rows Removed by Filter: 0
                                       Buffers: shared read=4
                                       I/O Timings: read=8.566 write=0.000
                                 ->  Index Only Scan using index_groups_on_parent_id_id on public.namespaces namespaces_1  (cost=0.43..3.45 rows=1 width=4) (actual time=0.000..0.000 rows=0 loops=0)
                                       Index Cond: ((namespaces_1.parent_id IS NULL) AND (namespaces_1.id = members.source_id))
                                       Heap Fetches: 0
                                       I/O Timings: read=0.000 write=0.000

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
image image

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 John Mason

Merge request reports

Loading