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.

CN121785884APending Publication Date: 2026-04-03AISINO CORPORATION
View PDF 0 Cites -1 Cited by

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

Technical Problem

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.

Method used

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.

Benefits of technology

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.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121785884A_ABST
    Figure CN121785884A_ABST
Patent Text Reader

Abstract

The invention discloses a method and system for evaluating the quality of SQL statements generated by a large model. The method comprises the steps that the large model, a generated target SQL statement and a standard SQL statement which aim at the same query requirement are obtained; obtaining a corresponding query plan by analyzing the query performance of the target SQL statement and the standard SQL statement; extracting a plurality of dimension features in the query plan; and obtaining a comprehensive score of the target SQL statement and the standard SQL statement according to the score of each evaluation item of each preset dimension feature, and generating an evaluation result of the SQL statement according to the comprehensive score. And quantitatively evaluating the advantages and disadvantages of SQL statements generated by the large model from a multi-dimensional query plan feature comparison system.
Need to check novelty before this filing date? Find Prior Art