Skip to content

Filter build by partition_id

Max Orefice requested to merge morefice/filter-ci-build-in-by-partition-3 into master

What does this MR do and why?

Ref: #423054 (closed)

What does this MR do and why?

Following up !137553 (merged)

This MR allows to make sure we always fetch a given build record in the proper partition where the data is in by including partition_id in the where clause for the following models:

This will allow us to take advantage of partition pruning and select the right partition automatically without scanning all of them.

Example of updated query

SELECT 1 AS one
FROM "p_ci_builds"
WHERE "p_ci_builds"."type" = 'Ci::Bridge'
AND "p_ci_builds"."upstream_pipeline_id" = 561
+ AND "p_ci_builds"."partition_id" = 100
LIMIT 1

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Max Orefice

Merge request reports

Loading