Add index for partitioned PK on ci_stages
Technical Proposal
Prepare Ci::Stage
for partitioning, similar to what we did to partition Ci::BuildMetadata.
It creates asynchronous indexes required to partition this table:
Indexes:
"ci_stages_pkey" PRIMARY KEY, btree (id)
"index_ci_stages_on_pipeline_id_and_name" UNIQUE, btree (pipeline_id, name)
"index_ci_stages_on_pipeline_id_convert_to_bigint_and_name" UNIQUE, btree (pipeline_id_convert_to_bigint, name)
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_stages
as explained in this MR introducing zero partition helper.
Edited by Panos Kanellidis