Skip to content

Cleanup unused indexes and referenced fks for ci_job_artifacts

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

Ref: #435802 (closed)

What does this MR do and why?

This MR does 2 things in order to prepare ci_job_artifacts to be partitioned:

  • Drop one index longer being used (see thanos queries below) and schedule one to be removed this weekend during low traffic
  • Remove one FK which was updated to include partition_id in !138898 (merged)

Why are we doing this?

Mandatory steps in order to partition a table as explained in our documentation.

Database

Looks like we can remove those indexes are they are not being used anymore 👇

Old index New index
index_ci_build_trace_metadata_on_trace_artifact_id index_ci_build_trace_metadata_on_trace_artifact_id_partition_id
index_ci_job_artifact_states_on_job_artifact_id index_ci_job_artifact_states_on_job_artifact_id_partition_id
Edited by Max Orefice

Merge request reports