Add index for partitioned PK on ci_pipeline_variables
Technical Proposal
Prepare Ci::PipelineVariable
for partitioning, similar to what we did to partition Ci::BuildMetadata.
It creates 2 asynchronous indexes required to partition this table:
The indexes that need to be updated to include the partition_id
column are the following:
Indexes:
"ci_pipeline_variables_pkey" PRIMARY KEY, btree (id)
"index_ci_pipeline_variables_on_pipeline_id_and_key" UNIQUE, btree (pipeline_id, key)
We don't need to remove the ci_pipeline_variables_pkey
index as it will be removed when swapping the primary_key.
Additionally create a synchronous index which will act as a no-op
on gitlab.com
.
You can follow the documentation to create those indexes locally.
Why are we doing this?
Those indexes will be used to partition ci_pipeline_variables
as explained in this MR introducing zero partition helper.
Edited by Panos Kanellidis