Skip to content

Geo - Support filtering uploads registries by keyword via GraphQL

What does this MR do and why?

Currently, for self-service replicables, we are unable to do any filtering on the Geo Replicable views.

This MR supports filtering uploads registries by keyword via GraphQL:

Registries Searchable attributes
Uploads Checksum

Database

Raw SQL and query plans

Using:

Upload.search('85418cc881d37d83c7e681bc43f63731bf0849e06dc59fa8fa2dcf5448a47b8e')

Then:

https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/15094/commands/52548

SELECT
    uploads.*
FROM
    uploads
WHERE
    uploads.checksum = '85418cc881d37d83c7e681bc43f63731bf0849e06dc59fa8fa2dcf5448a47b8e'
LIMIT 1000;

Query plan:

 Limit  (cost=0.56..3.58 rows=1 width=279) (actual time=3.478..3.479 rows=0 loops=1)
   Buffers: shared read=4
   I/O Timings: read=3.447 write=0.000
   ->  Index Scan using index_uploads_on_checksum on public.uploads  (cost=0.56..3.58 rows=1 width=279) (actual time=3.476..3.476 rows=0 loops=1)
         Index Cond: ((uploads.checksum)::text = '85418cc881d37d83c7e681bc43f63731bf0849e06dc59fa8fa2dcf5448a47b8e'::text)
         Buffers: shared read=4
         I/O Timings: read=3.447 write=0.000

Statistics:

Time: 5.022 ms
  - planning: 1.518 ms
  - execution: 3.504 ms
    - I/O read: 3.447 ms
    - I/O write: 0.000 ms

Shared buffers:
  - hits: 0 from the buffer pool
  - reads: 4 (~32.00 KiB) from the OS file cache, including disk I/O
  - dirtied: 0
  - writes: 0

MR acceptance checklist

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

Related to #364722 (closed) and #411770

Edited by Javiera Tapia

Merge request reports