Selectivity Functions of Range Queries are Learnable
Xiao Hu, Yuxi Liu, Haibo Xiu, Pankaj K. Agarwal, Debmalya Panigrahi, Sudeepa Roy, Jun Yang
Abstract
This paper explores the use of machine learning for estimating the selectivity of range queries in database systems. Using classic learning theory for real-valued functions based on shattering dimension, we show that the selectivity function of a range space with bounded VC-dimension is learnable. As many popular classes of queries (e.g., orthogonal range search, inequalities involving linear combination of attributes, distance-based search, etc.) represent range spaces with finite VC-dimension, our result immediately implies that their selectivity functions are also learnable. To the best of our knowledge, this is the first attempt at formally explaining the role of machine learning techniques in selectivity estimation, and complements the growing literature in empirical studies in this direction. Supplementing these theoretical results, our experimental results demonstrate that, empirically, even a basic learning algorithm with generic models is able to produce accurate predictions across settings, matching state-of-art methods designed for specific queries, and using training sample sizes commensurate with our theory.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
8 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- WISK: A Workload-aware Learned Index for Spatial Keyword Queries cites Are We Ready For Learned Cardinality Estimation?
- Theoretical Analysis of Learned Database Operations under Distribution Shift through Distribution Learnability cites Are We Ready For Learned Cardinality Estimation?
- Theoretical Analysis of Learned Database Operations under Distribution Shift through Distribution Learnability cites Deep Unsupervised Cardinality Estimation
- Theoretical Analysis of Learned Database Operations under Distribution Shift through Distribution Learnability cites Towards Establishing Guaranteed Error for Learned Database Operations
- Theoretical Analysis of Learned Database Operations under Distribution Shift through Distribution Learnability cites NeuroSketch: Fast and Approximate Evaluation of Range Aggregate Queries with Neural Networks
- Are We Ready For Learned Cardinality Estimation? cites Deep Learning Models for Selectivity Estimation of Multi-Attribute Queries
- Are We Ready For Learned Cardinality Estimation? cites Deep Unsupervised Cardinality Estimation
- Are We Ready For Learned Cardinality Estimation? cites QuickSel: Quick Selectivity Learning with Mixture Models
- PARQO: Penalty-Aware Robust Plan Selection in Query Optimization cites Are We Ready For Learned Cardinality Estimation?
- PARQO: Penalty-Aware Robust Plan Selection in Query Optimization cites Bao: Making Learned Query Optimization Practical
- Deep Unsupervised Cardinality Estimation cites QuickSel: Quick Selectivity Learning with Mixture Models
- QuickSel: Quick Selectivity Learning with Mixture Models cites Deep Unsupervised Cardinality Estimation
- Towards Establishing Guaranteed Error for Learned Database Operations cites Deep Unsupervised Cardinality Estimation
- NeuroSketch: Fast and Approximate Evaluation of Range Aggregate Queries with Neural Networks cites Deep Unsupervised Cardinality Estimation
- Bao: Making Learned Query Optimization Practical cites Deep Unsupervised Cardinality Estimation
- Bao: Making Learned Query Optimization Practical cites QuickSel: Quick Selectivity Learning with Mixture Models
Cited by top-tier papers8
- WISK: A Workload-aware Learned Index for Spatial Keyword QueriesYufan Sheng, Xin Cao, Yixiang Fang, Kaiqi Zhao et al.SIGMOD 2023 · 24 citations
- NeuroSketch: Fast and Approximate Evaluation of Range Aggregate Queries with Neural NetworksSepanta Zeighami, Cyrus Shahabi, Vatsal SharanSIGMOD 2023 · 9 citations
- PARQO: Penalty-Aware Robust Plan Selection in Query OptimizationHaibo Xiu, Pankaj K. Agarwal, Jun YangVLDB 2024 · 8 citations
- Theoretical Analysis of Learned Database Operations under Distribution Shift through Distribution LearnabilitySepanta Zeighami, Cyrus ShahabiICML 2024 · 5 citations
- Towards Establishing Guaranteed Error for Learned Database OperationsSepanta Zeighami, Cyrus ShahabiICLR 2024 · 4 citations
Builds on7
- Bao: Making Learned Query Optimization PracticalRyan Marcus, Parimarjan Negi, Hongzi Mao, Nesime Tatbul et al.SIGMOD 2021 · 242 citations
- Deep Unsupervised Cardinality EstimationZongheng Yang, Eric Liang, Amog Kamsetty, Chenggang Wu et al.VLDB 2020 · 206 citations
- Are We Ready For Learned Cardinality Estimation?Xiaoying Wang, Changbo Qu, Weiyuan Wu, Jiannan Wang et al.VLDB 2021 · 156 citations
- Deep Learning Models for Selectivity Estimation of Multi-Attribute QueriesShohedul Hasan, Saravanan Thirumuruganathan, Jees Augustine, Nick Koudas et al.SIGMOD 2020 · 101 citations
- QuickSel: Quick Selectivity Learning with Mixture ModelsYongjoo Park, Shucheng Zhong, Barzan MozafariSIGMOD 2020 · 66 citations
Related papers
- Consistent and Flexible Selectivity Estimation for High-Dimensional DataYaoshu Wang, Chuan Xiao, Jianbin Qin, Rui Mao et al.SIGMOD 2021 · 12 citations
- A Practical Theory of Generalization in Selectivity LearningPeizhi Wu, Haoshu Xu, Ryan Marcus, Zack IvesVLDB 2025 · 2 citations
- Selectivity Estimation for Queries Containing Predicates over Set-Valued AttributesZizhong Meng, Xin Cao, Gao CongSIGMOD 2024 · 7 citations
- Solving Fréchet Distance Problems by Algebraic Geometric MethodsSiu-Wing Cheng, Haoqiang HuangSODA 2024 · 4 citations
- How Many Domains Suffice for Domain Generalization? A Tight Characterization via the Domain Shattering DimensionCynthia Dwork, Lunjia Hu, Han ShaoNeurIPS 2025 · 3 citations
