• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

Computer Engineering & Science ›› 2026, Vol. 48 ›› Issue (1): 146-161.

• Artificial Intelligence and Data Mining • Previous Articles     Next Articles

Overview of database query rewrite technology

LI Yijie,GAO Jintao,LIANG Pu   

  1. (School of Information Engineering,Ningxia University,Yinchuan 750021,China)
  • Received:2024-03-18 Revised:2024-09-29 Online:2026-01-25 Published:2026-01-25

Abstract: The syntax for writing query statements in databases is highly diverse and flexible, with vastly different query formulations possible for the same requirement. The execution performance of queries directly impacts user experience. Query rewriting techniques transform an input query into an equivalent query with superior performance. Given the numerous rewriting rules and complex query environments, designing high-quality query rewriting strategies poses a significant challenge. Traditional query rewriting strategies are either cost-based or heuristic-based; however, achieving optimal query rewriting results in complex query environments remains difficult. With the rise of AI for databases (AI4DB), integrating machine learning methods into query rewriting techniques has become a mainstream approach, enabling further resolution of issues present in traditional query rewriting. Therefore, this paper first elaborates on the relevant technologies, existing problems, and applicable scenarios of traditional query rewriting strategies. Then it introduces machine learning-based query rewriting strategies, with a focus on discussing how they enhance performance. Finally, it discusses the current challenges in query rewriting and offers perspectives on future research directions.


Key words: query rewrite, rewrite strategy, machine learning, query optimization