Method and system for evaluating quality of SQL statement generated by large model
By extracting query plan features from large models to generate SQL statements and combining them with multi-dimensional evaluation criteria, the limitations and execution efficiency issues of SQL statement quality evaluation in existing technologies are resolved, enabling comprehensive and accurate evaluation and optimization guidance for SQL statements.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-19
- Publication Date
- 2026-04-03
AI Technical Summary
Existing technologies lack a systematic set of technical indicators when evaluating the quality of SQL statements generated by large language models. They cannot identify problems where the results are correct but the execution logic is inefficient. Furthermore, they fail to perform in-depth verification in conjunction with database execution principles, which may lead to performance failures in production environments due to low execution efficiency of the generated SQL.
By analyzing the query performance of target SQL statements and standard SQL statements, query plans are obtained, and features such as operation type, index usage, table join path, and execution efficiency are extracted. Based on preset scoring criteria, a comprehensive score is generated to achieve a comprehensive evaluation of the quality of SQL statements.
It provides a more comprehensive and accurate method for evaluating the quality of SQL statements, which can cover key factors of SQL performance, judge the merits of SQL statements generated by large models and standard SQL statements written by DBAs, and provide optimization guidance.
Smart Images

Figure CN121785884A_ABST