Faper: Join Tree with Uncertainty Awareness for Faster, More Precise and Robust Cardinality Estimation
摘要
Query optimizers rely on precise cardinality estimation for optimal execution plans. The key challenge of cardinality estimation is modeling the joint attribute distribution. Nevertheless, current learning-based approaches often face issues like low accuracy, coarse-grained uncertainty, and lack of adaptation to workload drifts. We propose Faper, a query-driven cardinality estimation method that is Fast in probability computation, pr ecise in quality, and robust to workload drifts. It uses a join tree inference mechanism, focusing on node relationships. By combining spiking neural network and simple recurrent unit, it captures node intricacies of the join trees to boost accuracy and training efficiency. We also integrate Bayesian estimation techniques to enable fine-grained uncertainty quantification on the node-level. Experiments show that Faper outperforms existing methods, with a 40% increase in accuracy and 35% reduction in inference time. Available code is at https://github.com/different-dimension-demon/Faper .