Skip to content

Fix query timeouts in BackfillNamespaceTraversalIdsRoots

Imre Farkas requested to merge if-330967-fix_root_traversal_ids_backfill into master

What does this MR do?

Fix query timeouts in BackfillNamespaceTraversalIdsRoots background migration due to the query plan using wrong index.

Base query (without #update_all)

SELECT
  "namespaces".*
FROM
  "namespaces"
WHERE
  "namespaces"."parent_id" IS NULL
  AND "namespaces"."id" BETWEEN 1 AND 2
  AND (traversal_ids = '{}')

Original base query

SELECT
  "namespaces".*
FROM
  "namespaces"
WHERE
  "namespaces"."parent_id" IS NULL
  AND "namespaces"."id" BETWEEN 1 AND 3
  AND (traversal_ids = '{}')
  AND "namespaces"."id" >= 1

#330967 (closed)

Screenshots (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Imre Farkas

Merge request reports

Loading