Expand index on ci_pipelines
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
- Plan before (prod, cold, 21,000ms): https://explain.depesz.com/s/9RWl
- Plan before (prod, warm, 1,200ms): https://explain.depesz.com/s/JBd2
- Plan after (dblab, <1ms): https://explain.depesz.com/s/yWD1
- Index creation takes: 17.770 min
Does this MR meet the acceptance criteria?
Conformity
Edited by Alper Akgun