Skip to content

Drop duplicate index on p_ci_runner_machine_builds

Max Orefice requested to merge morefice/drop-duplicate-index-runner-machine into master

What does this MR do and why?

This MR drops index_ci_runner_machine_builds_on_runner_machine_id as it has been identified as a duplicated index.

We already have an index on runner_machine_id, this will free up ~3GB.

gitlabhq_development_ci=# \d+ p_ci_runner_machine_builds
                              Partitioned table "public.p_ci_runner_machine_builds"
      Column       |  Type  | Collation | Nullable | Default | Storage | Compression | Stats target | Description
-------------------+--------+-----------+----------+---------+---------+-------------+--------------+-------------
 partition_id      | bigint |           | not null |         | plain   |             |              |
 build_id          | bigint |           | not null |         | plain   |             |              |
 runner_machine_id | bigint |           | not null |         | plain   |             |              |
Partition key: LIST (partition_id)
Indexes:
    "p_ci_runner_machine_builds_pkey" PRIMARY KEY, btree (build_id, partition_id)
    "index_ci_runner_machine_builds_on_runner_machine_id" btree (runner_machine_id)
    "index_p_ci_runner_machine_builds_on_runner_machine_id" btree (runner_machine_id)
Foreign-key constraints:
    "fk_bb490f12fe_p" FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE
Partitions: gitlab_partitions_dynamic.ci_runner_machine_builds_100 FOR VALUES IN ('100'),
            gitlab_partitions_dynamic.ci_runner_machine_builds_101 FOR VALUES IN ('101')

Merge request reports