Skip to content

Expand index on ci_pipelines

Andreas Brandl requested to merge ab/ci-ref-index into master

What does this MR do?

This expands an index on ci_pipelines to improve query performance of a CI-related query. This has been detected to have a significant impact on workload on .com at the moment.

Please see #292454 (comment 463399893) for details.

The query is:

SELECT
    "ci_pipelines"."id"
FROM
    "ci_pipelines"
WHERE
    "ci_pipelines"."ci_ref_id" = 2439091
    AND ("ci_pipelines"."source"  = ANY ('{1,2,3,4,5,6,7,8,10,11}'::integer[])
        OR "ci_pipelines"."source" IS NULL)
    AND ("ci_pipelines"."status" = ANY ('{success,failed,canceled}'::text[]))
ORDER BY
    "id" DESC
LIMIT 1

Does this MR meet the acceptance criteria?

Conformity

Edited by Alper Akgun

Merge request reports

Loading