Skip to content

Add indexes to ci_job_artifacts referenced FK

Max Orefice requested to merge morefice/add-index-ci-job-artifacts-fk into master

Ref: &11817 (closed)

What does this MR do and why?

Following up !138898 (merged)

This will be no-op operation gitlab.com.

This MR adds a migration which will create 2 indexes for users outside of gitlab.com as explained in our documentation.

Why are we doing this?

Those indexes are required in order to partition ci_job_artifacts as all FK referenced should include the partition key in order to be able to partition our table.

Database

+ "index_ci_build_trace_metadata_on_trace_artifact_id_partition_id" btree (trace_artifact_id, partition_id)
+ "index_ci_job_artifact_states_on_job_artifact_id_partition_id" btree (job_artifact_id, partition_id)

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 Max Orefice

Merge request reports