QueryGuide: Fine-grained Query Hint Recommendation Method via Generative Model
Author:
Affiliation:

Clc Number:

TP311

Fund Project:

  • Article
  • |
  • Figures
  • |
  • Metrics
  • |
  • Reference
  • |
  • Related
  • |
  • Cited by
  • |
  • Materials
  • |
  • Comments
    Abstract:

    A slow query refers to a query whose execution time exceeds the threshold defined by the database system, thus degrading overall performance. Due to limited developer experience and inflexible query interface templates, slow queries frequently occur in applications and are a major cause of database failures. To accelerate slow queries, database administrators often perform manual tuning. However, manual tuning is inefficient for large volumes of data, making research on automatic query rewriting methods for slow queries particularly important. Query hints are tuning directives that explicitly influence optimizer decisions and can improve query performance by affecting strategies such as access paths. As an important research problem in the field of database query rewriting, query hint recommendation has received widespread attention. However, existing machine learning-based hint recommendation methods still face issues such as coarse granularity and reliance on manually specified candidate sets. To address these issues, this study proposes QueryGuide, a fine-grained hint recommendation framework based on a generative model. By exploring the optimal combinations of different fine-grained hints, the execution efficiency of physical plans for rewritten queries is improved. Specifically, on the one hand, the framework explores recommendation strategies based on generative language models, investigates the performance improvement of hints on slow queries in database environments, and uses it as rewards for model fine-tuning, thus generating fine-grained, table-level hints. On the other hand, the fine-grained hints recommended by the generative model are used as exploration directions, and hint combinations are obtained through expansion. The exploration results of these combinations are used for model fine-tuning, enabling the model to learn the impact of different hint combinations on slow query rewriting performance and to identify the optimal hint combination. Experimental results on multiple datasets demonstrate that, compared with other baseline algorithms, the proposed method exhibits better rewriting performance and significantly reduces query execution time.

    Reference
    Related
    Cited by
Get Citation

杨少聪,王宁. QueryGuide: 基于生成式模型的细粒度查询提示推荐方法.软件学报,,():1-18

Copy
Share
Article Metrics
  • Abstract:
  • PDF:
  • HTML:
  • Cited by:
History
  • Received:July 05,2025
  • Revised:November 10,2025
  • Adopted:
  • Online: June 10,2026
  • Published:
You are the firstVisitors
Copyright: Institute of Software, Chinese Academy of Sciences Beijing ICP No. 05046678-4
Address:4# South Fourth Street, Zhong Guan Cun, Beijing 100190,Postal Code:100190
Phone:010-62562563 Fax:010-62562533 Email:jos@iscas.ac.cn
Technical Support:Beijing Qinyun Technology Development Co., Ltd.

Beijing Public Network Security No. 11040202500063