Index creation suggestion on ci_builds_metadata

@asotolongo suggested the index creation:

About this query, which is the most frequent in IO wait events in peaks detected, with a covering index can help to use Index Only Scan:

create index concurrently index_ci_builds_metadata_on_build_id_and_interruptible_inlcude on ci_builds_metadata (build_id) INCLUDE (id) WHERE interruptible = true;

and the new plan is about 20% faster:

New plan using the covering index:

https://explain.depesz.com/s/w1zK

Old plan:

https://explain.depesz.com/s/sCZR

Based in the discussion on the thread: https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/12116#note_477844446

Assignee Loading
Time tracking Loading