Skip to content

Reduce scope of catalog resources listing to only public and internal

Leaminn Ma requested to merge ci-catalog-resources-limit-to-public-internal into master

What does this MR do and why?

Background context:

Mixing private and public data in the CI search functionality will cause performance degradation in the future and will impede our ability to scale. Further details are explained in #429056 (comment 1641496694). For this reason, we must reduce the scope of the queries in Ci::Catalog::Resource::Listing to only Public and Internal for the first iteration. This was agreed upon for Beta release in #429056 (comment 1641537078).

This MR:

Originally, we planned to reduce the scope in Step 5 of #429056 (closed), after denormalizing visibility_level. However, the denormalizing and syncing effort will take several MRs and review cycles, which significantly delays the scope change.

So in the interest of time, we'll proceed with this scope reduction in this MR using the unoptimized query.

Query

SELECT "catalog_resources".*, "projects".* -- Compacted select statement
FROM "catalog_resources" INNER JOIN "projects" ON "projects"."id" = "catalog_resources"."project_id"
WHERE "projects"."visibility_level" IN (10, 20)

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 #429056 (closed)

Edited by Leaminn Ma

Merge request reports

Loading