Forgetting by Pruning: Data Deletion in Join Cardinality Estimation
Chaowei He, Yuanjun Liu, Qingzhi Ma, Shenyuan Ren, Xizhao Luo, Lei Zhao, An Liu
TL;DR
This work addresses the challenge of unlearning in multi-table learned cardinality estimation by introducing Cardinality Estimation Pruning (CEP). CEP combines Distribution Sensitivity Pruning, which uses distributional shifts and a diagonal Fisher Information approximation to identify and prune sensitive parameters, with Domain Pruning, which removes erased value domains from the input space. Evaluated on NeuroCard and FACE with IMDB and TPC-H data, CEP consistently achieves the lowest Q-error under varying deletion ratios and scales effectively to large multi-table joins, often outperforming full retraining while incurring only a small overhead. The results demonstrate CEP as a practical, lightweight unlearning solution for dynamic database systems that require frequent data deletions, with avenues for extending to insertions, updates, and integration into query optimizers.
Abstract
Machine unlearning in learned cardinality estimation (CE) systems presents unique challenges due to the complex distributional dependencies in multi-table relational data. Specifically, data deletion, a core component of machine unlearning, faces three critical challenges in learned CE models: attribute-level sensitivity, inter-table propagation and domain disappearance leading to severe overestimation in multi-way joins. We propose Cardinality Estimation Pruning (CEP), the first unlearning framework specifically designed for multi-table learned CE systems. CEP introduces Distribution Sensitivity Pruning, which constructs semi-join deletion results and computes sensitivity scores to guide parameter pruning, and Domain Pruning, which removes support for value domains entirely eliminated by deletion. We evaluate CEP on state-of-the-art architectures NeuroCard and FACE across IMDB and TPC-H datasets. Results demonstrate CEP consistently achieves the lowest Q-error in multi-table scenarios, particularly under high deletion ratios, often outperforming full retraining. Furthermore, CEP significantly reduces convergence iterations, incurring negligible computational overhead of 0.3%-2.5% of fine-tuning time.
