SLQ: Lightweight-Detection & LLM-Generation SQL SelfOptimization Framework
In real-world database applications, SQL statements written by users often create performance bottlenecks because they violate best-practice rules. Traditional rule-based detectors have limited ability to recognize diverse and increasingly irregular statements and are costly to maintain. To address this, we propose SLQ, a two-stage intelligent SQL optimization framework. First, a lightweight stacked-LSTM module pinpoints problematic statements; then a pre-trained large language model, Qwen3, automatically generates explanations for each flaw and offers targeted rewrite suggestions, helping users quickly improve query quality. Evaluated on a standard dataset, SLQ achieves accuracy, precision, recall and F1 of 0.9841, 0.9974, 0.9702 and 0.9836 respectively, demonstrating superior detection and optimization capability and markedly enhancing SQL compliance and execution efficiency.
Authors
- Zhu Tianyou
- Qi Yaru
- Yang Chao
- Jiang Kongchen
- Sang Yanting
Publication Details
- Journal
- SHILAP Revista de lepidopterología
- Published
- 2026-02-01
- DOI
- https://doi.org/10.6180/jase.202607_30.025
- Primary Topic
- Advanced Database Systems and Queries
- Type
- article
- Field-Weighted Citation Impact
- 0.00