Adding partitions for ci_stage associations
What does this MR do and why?
Adding partition pruning when referencing ci_stages
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
- Ensure associations between models are still correct and use partition_id filter in the where clause
- Eg:
Ci::Build.first.ci_stage -> WHERE "p_ci_stages"."id" = 1 AND "p_ci_stages"."partition_id" = 100
Ci::Pipeline.first.stages -> WHERE "p_ci_stages"."pipeline_id" = 1 AND "p_ci_stages"."partition_id" = 100
Ci::Stage.first.pipeline -> WHERE "ci_pipelines"."id" = 1 AND "ci_pipelines"."partition_id" = 100
Related to #430295 (closed)
Edited by Max Fan