Skip to content

Add name to ci_builds_gitlab_monitor_metrics index

What does this MR do and why?

Preparation for filtering jobs by name !106458

  • Adds name column to index async
  • Removes old index async

Screenshots or screen recordings

Query testing results

Query

plan SELECT "ci_builds".* FROM "ci_builds" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."project_id" = 278964 AND ("ci_builds"."status" NOT IN ('created')) AND "ci_builds"."name" = 'detect-tests' AND ("ci_builds"."status" IN ('success')) ORDER BY "ci_builds"."id" DESC

Plan

Sort  (cost=61096088.46..61096109.17 rows=8286 width=1250)
  Sort Key: id DESC
  ->  Index Scan using "<13343>btree_ci_builds_status_created_at_project_id_name" on ci_builds  (cost=0.08..61095549.19 rows=8286 width=1250)
        Index Cond: (((status)::text = 'success'::text) AND (project_id = 278964) AND ((name)::text = 'detect-tests'::text))

Console using hypo

On instance https://console.postgres.ai/gitlab/joe-instances/114

Screen_Shot_2022-12-13_at_4.26.17_PM

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Payton Burdette

Merge request reports