Astrid: Accurate Selectivity Estimation for String Predicates using Deep Learning
Suraj Shetiya, Saravanan Thirumuruganathan, Nick Koudas, Gautam Das
Abstract
Accurate selectivity estimation for string predicates is a long-standing research challenge in databases. Supporting pattern matching on strings (such as prefix, substring, and suffix) makes this problem much more challenging, thereby necessitating a dedicated study. Traditional approaches often build pruned summary data structures such as tries followed by selectivity estimation using statistical correlations. However, this produces insufficiently accurate cardinality estimates resulting in the selection of sub-optimal plans by the query optimizer. Recently proposed deep learning based approaches leverage techniques from natural language processing such as embeddings to encode the strings and use it to train a model. While this is an improvement over traditional approaches, there is a large scope for improvement. We propose Astrid, a framework for string selectivity estimation that synthesizes ideas from traditional and deep learning based approaches. We make two complementary contributions. First, we propose an embedding algorithm that is query-type (prefix, substring, and suffix) and selectivity aware. Consider three strings 'ab', 'abc' and 'abd' whose prefix frequencies are 1000, 800 and 100 respectively. Our approach would ensure that the embedding for 'ab' is closer to 'abc' than 'abd'. Second, we describe how neural language models could be used for selectivity estimation. While they work well for prefix queries, their performance for substring queries is sub-optimal. We modify the objective function of the neural language model so that it could be used for estimating selectivities of pattern matching queries. We also propose a novel and efficient algorithm for optimizing the new objective function. We conduct extensive experiments over benchmark datasets and show that our proposed approaches achieve state-of-the-art results.
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.
15 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
- Robust Query Driven Cardinality Estimation under Changing Workloads cites Deep Learning Models for Selectivity Estimation of Multi-Attribute Queries
- Robust Query Driven Cardinality Estimation under Changing Workloads cites DeepDB: Learn from Data, not from Queries!
- Robust Query Driven Cardinality Estimation under Changing Workloads cites Learned Cardinality Estimation: An In-depth Study
- Robust Query Driven Cardinality Estimation under Changing Workloads cites Deep Unsupervised Cardinality Estimation
- Robust Query Driven Cardinality Estimation under Changing Workloads cites Cardinality Estimation in DBMS: A Comprehensive Benchmark Evaluation
- DeepDB: Learn from Data, not from Queries! cites An End-to-End Learning-based Cost Estimator
- QueryFormer: A Tree Transformer Model for Query Plan Representation cites An End-to-End Learning-based Cost Estimator
- Balsa: Learning a Query Optimizer Without Expert Demonstrations cites Deep Unsupervised Cardinality Estimation
- Balsa: Learning a Query Optimizer Without Expert Demonstrations cites An End-to-End Learning-based Cost Estimator
- Learned Cardinality Estimation: An In-depth Study cites Deep Learning Models for Selectivity Estimation of Multi-Attribute Queries
- Learned Cardinality Estimation: An In-depth Study cites DeepDB: Learn from Data, not from Queries!
- Learned Cardinality Estimation: An In-depth Study cites Deep Unsupervised Cardinality Estimation
- Learned Cardinality Estimation: An In-depth Study cites An End-to-End Learning-based Cost Estimator
- Cardinality Estimation in DBMS: A Comprehensive Benchmark Evaluation cites Deep Learning Models for Selectivity Estimation of Multi-Attribute Queries
- Cardinality Estimation in DBMS: A Comprehensive Benchmark Evaluation cites DeepDB: Learn from Data, not from Queries!
- Cardinality Estimation in DBMS: A Comprehensive Benchmark Evaluation cites An End-to-End Learning-based Cost Estimator
Cited by top-tier papers15
- Cardinality Estimation in DBMS: A Comprehensive Benchmark EvaluationYuxing Han, Ziniu Wu, Peizhi Wu, Rong Zhu et al.VLDB 2022 · 169 citations
- QueryFormer: A Tree Transformer Model for Query Plan RepresentationYue Zhao, Gao Cong, Jiachen Shi, Chunyan MiaoVLDB 2022 · 117 citations
- Balsa: Learning a Query Optimizer Without Expert DemonstrationsZongheng Yang, Wei-Lin Chiang, Sifei Luan, Gautam Mittal et al.SIGMOD 2022 · 99 citations
- Robust Query Driven Cardinality Estimation under Changing WorkloadsParimarjan Negi, Ziniu Wu, Andreas Kipf, Nesime Tatbul et al.VLDB 2023 · 88 citations
- Learned Cardinality Estimation: An In-depth StudyKyoungmin Kim, Jisung Jung, In Seo, Wook-Shin Han et al.SIGMOD 2022 · 51 citations
Builds on5
- An End-to-End Learning-based Cost EstimatorJi Sun, Guoliang LiVLDB 2020 · 251 citations
- Deep Unsupervised Cardinality EstimationZongheng Yang, Eric Liang, Amog Kamsetty, Chenggang Wu et al.VLDB 2020 · 206 citations
- DeepDB: Learn from Data, not from Queries!Benjamin Hilprecht, Andreas Schmidt, Moritz Kulessa, Alejandro Molina et al.VLDB 2020 · 154 citations
- Creating Embeddings of Heterogeneous Relational Datasets for Data Integration TasksRiccardo Cappuzzo, Paolo Papotti, Saravanan ThirumuruganathanSIGMOD 2020 · 139 citations
- Deep Learning Models for Selectivity Estimation of Multi-Attribute QueriesShohedul Hasan, Saravanan Thirumuruganathan, Jees Augustine, Nick Koudas et al.SIGMOD 2020 · 101 citations
Related papers
- Cardinality Estimation of Approximate Substring Queries using Deep LearningSuyong Kwon, Woohwan Jung, Kyuseok ShimVLDB 2022 · 10 citations
- LPLM: A Neural Language Model for Cardinality Estimation of LIKE-QueriesMehmet Aytimur, Silvan Reiner, Leonard Wörteler, Theodoros Chondrogiannis et al.SIGMOD 2024 · 13 citations
- Selectivity Estimation for Queries Containing Predicates over Set-Valued AttributesZizhong Meng, Xin Cao, Gao CongSIGMOD 2024 · 7 citations
- Cardinality Estimation of LIKE Predicate Queries using Deep LearningSuyong Kwon, Kyuseok Shim, Woohwan JungSIGMOD 2025 · 3 citations
- Monotonic Cardinality Estimation of Similarity Selection: A Deep Learning ApproachYaoshu Wang, Chuan Xiao, Jianbin Qin, Xin Cao et al.SIGMOD 2020 · 19 citations
