Skip to content

WIP: Add index for slow queries in BuildsController#index

Stan Hu requested to merge sh-add-ci-build-indexes into master

The worst queries in loading this page looked like this:

SELECT COUNT("ci_builds"."id") FROM "ci_builds" WHERE "ci_builds"."type" IN ('Ci::Build') AND "ci_builds"."gl_project_id" = $1 AND ("ci_builds"."status" != $2)  [["gl_project_id", 10], ["status", "created"]]

This led to a bitmap heap scan that took 6-7 seconds in production.

Closes #27389 (closed)

Merge request reports