Skip to content

PoC for removing partitioned data using foreign keys

Description

Like in #357384 (closed) we want to ship a PoC that will prove that we can efficiently remove resources associated with pipelines (builds, stages, artifacts) using foreign keys and ON DELETE CASCADE with partitioned CI/CD schema.

We want to better understand if using foreign keys with ON DELETE CASCADE will have to scan all partitions to perform a removal. Is it even possible to rely ON DELETE CASCADE with foreign keys in that case https://www.2ndquadrant.com/en/blog/postgresql-12-foreign-keys-and-partitioned-tables/?

Objectives

Check if removing resources through foreign keys actually makes it possible to scan all partitions.

/cc @fabiopitino @mbobin @morefice @jheimbuck_gl

Edited by Grzegorz Bizon