Prepare Ci::JobArtifact for partitioning 1/3
Ref: #429002 (closed)
What does this MR do and why?
This MR prepares Ci::JobArtifact
for partitioning and will enqueue 2 index that will be created this weekend during low traffic.
It creates 2 asynchronous indexes required to partition this table:
- Primary key:
ci_jobs_artifacts (id, partition_id)
. - Unique constraint
ci_jobs_artifacts (job_id, file_type, partition_id)
.
Indexes:
"ci_job_artifacts_pkey" PRIMARY KEY, btree (id)
"index_ci_job_artifacts_on_job_id_and_file_type" UNIQUE, btree (job_id, file_type)
In a follow up MR we will add those indexes for self-instance users and this will create the following schema:
Indexes:
"ci_job_artifacts_pkey" PRIMARY KEY, btree (id, partition_id)
"idx_ci_job_artifacts_on_job_id_file_type_and_partition_id_uniq" UNIQUE, btree (job_id, file_type, partition_id)
Why are we doing this?
Mandatory steps in order to partition a table as explained in our documentation.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Max Orefice