SQLCheck: Automated Detection and Diagnosis of SQL Anti-Patterns
Prashanth Dintyala, Arpit Narechania, Joy Arulraj
Abstract
The emergence of database-as-a-service platforms has made deploying database applications easier than before. Now, developers can quickly create scalable applications. However, designing performant, maintainable, and accurate applications is challenging. Developers may unknowingly introduce anti-patterns in the application's SQL statements. These anti-patterns are design decisions that are intended to solve a problem, but often lead to other problems by violating fundamental design principles.
In this paper, we present sqlcheck, a holistic toolchain for automatically finding and fixing anti-patterns in database applications. We introduce techniques for automatically (1) detecting anti-patterns with high precision and recall, (2) ranking the anti-patterns based on their impact on performance, maintainability, and accuracy of applications, and (3) suggesting alternative queries and changes to the database design to fix these anti-patterns. We demonstrate the prevalence of these anti-patterns in a large collection of queries and databases collected from open-source repositories. We introduce an anti-pattern detection algorithm that augments query analysis with data analysis. We present a ranking model for characterizing the impact of frequently occurring anti-patterns. We discuss how sqlcheck suggests fixes for high-impact anti-patterns using rule-based query refactoring techniques. Our experiments demonstrate that sqlcheck enables developers to create more performant, maintainable, and accurate applications.
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 de6d9ae0-e2ee-4aaa-aed6-25df095d5239Cited by top-tier papers7
- Fine-Grained Lineage for Safer Notebook InteractionsStephen Macke, Aditya G. Parameswaran, Hongpu Gong, Doris Jung Lin Lee et al.VLDB 2021 · 46 citations
- WeTune: Automatic Discovery and Verification of Query Rewrite RulesZhaoguo Wang, Zhou Zhou, Yicun Yang, Haoran Ding et al.SIGMOD 2022 · 35 citations
- LearnedSQLGen: Constraint-aware SQL Generation using Reinforcement LearningLixi Zhang, Chengliang Chai, Xuanhe Zhou, Guoliang LiSIGMOD 2022 · 26 citations
- Proving Query Equivalence Using Linear Integer ArithmeticHaoran Ding, Zhaoguo Wang, Yicun Yang, Dexin Zhang et al.SIGMOD 2024 · 20 citations
- SlabCity: Whole-Query Optimization using Program SynthesisRui Dong, Jie Liu, Yuxuan Zhu, Cong Yan et al.VLDB 2023 · 11 citations
Related papers
- SAND: a static analysis approach for detecting SQL antipatternsYingjun Lyu, Sasha Volokh, William G. J. Halfond, Omer TrippISSTA 2021 · 13 citations
- Managing data constraints in database-backed web applicationsJunwen Yang, Utsav Sethi, Cong Yan, Alvin Cheung et al.ICSE 2020 · 9 citations
- APOLLO: Automatic Detection and Diagnosis of Performance Regressions in Database SystemsJinho Jung, Hong Hu, Joy Arulraj, Taesoo Kim et al.VLDB 2020 · 77 citations
- Are Machine Learning Cloud APIs Used Correctly?Chengcheng Wan, Shicheng Liu, Henry Hoffmann, Michael Maire et al.ICSE 2021 · 37 citations
- Detecting Transactional Bugs in Database Engines via Graph-Based Oracle ConstructionZu-Ming Jiang, Si Liu, Manuel Rigger, Zhendong SuOSDI 2023 · 28 citations
