Clean up indexes of ci_builds if possible

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

  • Close this issue

This table currently has the following indexes:

Indexes:
    "ci_builds_pkey" PRIMARY KEY, btree (id)
    "index_ci_builds_on_commit_id" btree (commit_id)
    "index_ci_builds_on_commit_id_and_stage_idx_and_created_at" btree (commit_id, stage_idx, created_at)
    "index_ci_builds_on_commit_id_and_status_and_type" btree (commit_id, status, type)
    "index_ci_builds_on_commit_id_and_type_and_name_and_ref" btree (commit_id, type, name, ref)
    "index_ci_builds_on_commit_id_and_type_and_ref" btree (commit_id, type, ref)
    "index_ci_builds_on_gl_project_id" btree (gl_project_id)
    "index_ci_builds_on_project_id" btree (project_id)
    "index_ci_builds_on_runner_id" btree (runner_id)
    "index_ci_builds_on_status" btree (status)

The various composite indexes may not be needed. commit_id is already indexed, with some clever re-designing we may be able to further cut down the number of indexes. This in turn would reduce the UPDATE overhead of this table.

cc @ayufan

Edited Jun 13, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading