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

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
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

SLQ: Lightweight-Detection & LLM-Generation SQL SelfOptimization Framework

Zhu Tianyou, Qi Yaru, Yang Chao, Jiang Kongchen et al.
SHILAP Revista de lepidopterología
Advanced Database Systems and Queries
article

SLQ: Lightweight-Detection & LLM-Generation SQL SelfOptimization Framework

Zhu Tianyou, Qi Yaru, Yang Chao, Jiang Kongchen, Sang Yanting
article en

Abstract

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.

SHILAP Revista de lepidopterología
Peace, Justice and strong institutions
Openalex Percentile: Top 68%
Advanced Database Systems and Queries
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.