Relational Algorithms for Top-k Query Evaluation
Qichen Wang, Qiyao Luo, Yilei Wang
Abstract
The evaluation of top-k conjunctive queries, a staple in business analysis, often requires evaluating the conjunctive query prior to filtering the top-k results, leading to a significant computational overhead within Database Management Systems (DBMSs). While efficient algorithms have been proposed, their integration into DBMSs remains arduous. We introduce relational algorithms, a paradigm where each algorithmic step is expressed by a relational operator. This allows the algorithm to be represented as a set of SQL queries, enabling easy deployment across different systems that support SQL. We introduce two novel relational algorithms, level-k and product-k, specifically designed for evaluating top-k conjunctive queries and demonstrate that level-k achieves optimal running time for top-k free-connex queries. Furthermore, these algorithms enable easy translation into an oblivious algorithm for secure query evaluations. The presented algorithms are not only theoretically optimal but also exhibit eminent efficiency in practice. The experiment results show significant improvements, with our rewritten SQL outperforming the baseline by up to 6 orders of magnitude. Moreover, our secure implementations not only achieve substantial speedup compared to the baseline with secure guarantees but even surpass those baselines that have no secure guarantees.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 27cfcac7-a6b5-49ec-aa7f-eedaf6936112Cited by top-tier papers2
- Yannakakis+: Practical Acyclic Query Evaluation with Theoretical GuaranteesQichen Wang, Bingnan Chen, Binyang Dai, Ke Yi et al.SIGMOD 2025 · 7 citations
- Succinct Structure Representations for Efficient Query OptimizationZhekai Jiang, Qichen Wang, Christoph KochSIGMOD 2026
Builds on15
- ABY3: A Mixed Protocol Framework for Machine LearningPayman Mohassel, Peter RindalCCS 2018 · 898 citations
- Senate: A Maliciously-Secure MPC Platform for Collaborative AnalyticsRishabh Poddar, Sukrit Kalra, Avishay Yanai, Ryan Deng et al.USENIX Security 2021 · 89 citations
- Efficient Oblivious Database JoinsSimeon Krastnikov, Florian Kerschbaum, Douglas StebilaVLDB 2020 · 57 citations
- SECRECY: Secure collaborative analytics in untrusted cloudsJohn Liagouris, Vasiliki Kalavri, Muhammad Faisal, Mayank VariaNSDI 2023 · 53 citations
- Optimal Algorithms for Ranked Enumeration of Answers to Full Conjunctive QueriesNikolaos Tziavelis, Deepak Ajwani, Wolfgang Gatterbauer, Mirek Riedewald et al.VLDB 2020 · 45 citations
Related papers
- Computing the Difference of Conjunctive Queries EfficientlyXiao Hu, Qichen WangSIGMOD 2023 · 9 citations
- Secure Yannakakis: Join-Aggregate Queries over Private DataYilei Wang, Ke YiSIGMOD 2021 · 49 citations
- Conjunctive Queries with ComparisonsQichen Wang, Ke YiSIGMOD 2022 · 13 citations
- External Merge Sort for Top-K Queries: Eager input filtering guided by histogramsYannis Chronis, Thanh Do, Goetz Graefe, Keith PetersSIGMOD 2020 · 4 citations
- Differentially Oblivious Multi-way JoinZhiang Wu, Wei Dong, Xiao HuSIGMOD 2026
