GT-Muzero: SQL Query Plan Optimization via Graph Transformers and Model-Based Reinforcement Learning

Abstract

Learning-based Structured Query Language (SQL) optimizers often face low sample efficiency and high training costs. To address these challenges, this study proposes a query optimization framework, GT- MuZero, which integrates a Graph Transformer (GT) with the model-based reinforcement learning (RL) algorithm MuZero. The framework converts SQL queries into heterogeneous graphs containing tables, predicates, and join operators. Structural encoding is performed via Laplacian feature vectors. GT’s global self-attention mechanism effectively overcomes the over-smoothing problem encountered by traditional Graph Neural Networks (GNNs) when processing deep execution trees. MuZero reduces reliance on costly real-database interactions by performing virtual forward planning in a learned latent space. Experiments on a high-performance server equipped with NVIDIA A100 GPUs, using the 100 GB TPC-DS benchmark datasets, demonstrated exceptional sample efficiency: GT-MuZero achieved 96.73% policy consistency with only 10,000 real training samples, whereas conventional methods such as GCN- PPO required more than 50,000 samples. Quantitative evaluation showed a geometric mean performance ratio (GMPR) of 2.81. Compared with the PostgreSQL baseline, latency for complex queries was reduced by more than 3.8 times. Although the average inference latency of 155 ms exhibits diminishing returns for minimal queries, the framework’s high sample efficiency and closed-loop robustness under large-scale, complex analytical workloads demonstrate its practical effectiveness and scientific value for building high-performance, adaptive intelligent database systems.

References

[1] Varadi M, Bertoni D, Magana P, Paramval U, Pidruchna I, Radhakrishnan M, et al. AlphaFold protein structure database in 2024: providing structure coverage for over 214 million protein sequences. Nucleic Acids Research. 2024, 52(D1):D368-D375. https://doi.org/10.1093/nar/gkad1011

[2] Patel L, Kraft P, Guestrin C, Zaharia M. Acorn: Performant and predicate-agnostic search over vector embeddings and structured data. Proceedings of the ACM on Management of Data. 2024, 2(3):1-27. https://doi.org/10.1145/3654923

[3] Saha BK, Gordon P, Gillbrand T. NLINQ: A natural language interface for querying network performance. Applied Intelligence. 2023, 53(23):28848-28864. https://doi.org/10.1007/s10489-023-05043-z

[4] Lauri J, Dutta S, Grassia M, Ajwani D. Learning fine-grained search space pruning and heuristics for combinatorial optimization. Journal of Heuristics. 2023, 29(2):313-347. https://doi.org/10.1007/s10732-023-09512-z

[5] Pan Z, Wang L, Dong C, Chen JF. A knowledge-guided end-to-end optimization framework based on reinforcement learning for flow shop scheduling. IEEE Transactions on Industrial Informatics. 2023, 20(2):1853-1861. https://doi.org/10.1109/tii.2023.3282313

[6] Rahman MM, Islam S, Kamruzzaman M, Joy ZH. Advanced query optimization in SQL databases for real-time big data analytics. Academic Journal on Business Administration, Innovation & Sustainability. 2024, 4(3):1-14. https://doi.org/10.69593/ajbais.v4i3.77

[7] Vinod DF, Ahlawat N. A Privacy Based Deep Learning Algorithm for Big Data Analytics. Informatica. 2025, 49(2):455-456. https://doi.org/10.31449/inf.v49i2.8763

[8] Milicevic B, Babovic Z. A systematic review of deep learning applications in database query execution. Journal of Big Data. 2024, 11(1):173. https://doi.org/10.1186/s40537-024-01025-1

[9] Choi D, Wee J, Song S, Lee H, Lim J, Bok K, et al. K-NN query optimization for high-dimensional index using machine learning. Electronics. 2023, 12(11):2375. https://doi.org/10.3390/electronics12112375

[10] Sassi N, Jaziri W. Efficient AI-driven query optimization in large-scale databases: A reinforcement learning and graph-based approach. Mathematics. 2025, 13(11):1700. https://doi.org/10.3390/math13111700

[11] Khan A, Ke X, Wu Y. Graph data management and graph machine learning: Synergies and opportunities. ACM SIGMOD Record. 2025, 54(2):28-42. https://doi.org/10.1145/3703551.3703558

[12] Li J, Kong X. TSS MLGNN: A Multi Level Graph Neural Network Approach for Text Semantic Similarity Computation. Informatica. 2025, 49(18):335-348. https://doi.org/10.31449/inf.v49i18.9641

[13] Guo Q, Wang Z. A Deep Reinforcement Learning Model-based Optimization Method for Graphic Design. Informatica. 2024, 48(5):121-134. https://doi.org/10.31449/inf.v48i5.5295

[14] Bhopale AP, Tiwari A. Transformer based contextual text representation framework for intelligent information retrieval. Expert Systems with Applications. 2024, 238:121629. https://doi.org/10.1016/j.eswa.2023.121629

[15] Xu Y, Bin Y, Wei J, Yang Y, Wang G, Shen HT. Multi-modal transformer with global-local alignment for composed query image retrieval. IEEE Transactions on Multimedia. 2023, 25:8346-8357. https://doi.org/10.1109/tmm.2023.3235495

[16] Hu W, Dou ZY, Li L, Kamath A, Peng N, Chang KW. Matryoshka query transformer for large vision-language models. Advances in Neural Information Processing Systems. 2024, 37:50168-50188. https://doi.org/10.52202/079017-1588

[17] Oliynyk D, Mayer R, Rauber A. I know what you trained last summer: A survey on stealing machine learning models and defences. ACM Computing Surveys. 2023, 55(14s):1-41. https://doi.org/10.1145/3595292

[18] Iftikhar A, Ghazanfar MA, Ayub M, Alahmari SA, Qazi N, Wall J. A reinforcement learning recommender system using bi-clustering and Markov decision process. Expert Systems with Applications. 2024, 237:121541. https://doi.org/10.1016/j.eswa.2023.121541

[19] Bose K, Das S. Can graph neural networks go deeper without over-smoothing? Yes, with a randomized path exploration! IEEE Transactions on Emerging Topics in Computational Intelligence. 2023, 7(5):1595-1604. https://doi.org/10.1109/tetci.2023.3249255

[20] Benoudifa O, Ait Wakrime A, Benaini R. Securing SDN controller placement with MuZero and blockchain-based smart contracts. Journal of King Saud University Computer and Information Sciences. 2025, 37(5):105. https://doi.org/10.1007/s44443-025-00014-5

[21] Guo W, Du H, Han T, Li S, Lu C, Huang X. Learning-driven load frequency control for islanded microgrid using graph networks-based deep reinforcement learning. Frontiers in Energy Research. 2024, 12:1517861. https://doi.org/10.3389/fenrg.2024.1517861

[22] Wang D, Gao N, Liu D, Li J, Lewis FL. Recent progress in reinforcement learning and adaptive dynamic programming for advanced control applications. IEEE/CAA Journal of Automatica Sinica. 2023, 11(1):18-36. https://doi.org/10.1109/jas.2023.123843

[23] Chen L, Wang Y, Miao Z, Mo Y, Feng M, Zhou Z, et al. Transformer-based imitative reinforcement learning for multirobot path planning. IEEE Transactions on Industrial Informatics. 2023, 19(10):10233-10243. https://doi.org/10.1109/tii.2023.3240585

[24] Li S, Li L, Geng R, Yang M, Li B, Yuan G, He W, Yuan S, Ma C, Huang F, Li Y. Unifying structured data as graph for data-to-text pre-training. Transactions of the Association for Computational Linguistics. 2024;12:210-228. https://doi.org/10.1162/tacl_a_00641

[25] Li S, Wang J, Liu C, Xiong H, Cheng L. BERT-GAT: Hierarchical Feature Interaction with Dynamic Multi-Hop Attention for Unstructured Data Management. Informatica. 2025, 49(20):367-380. https://doi.org/10.31449/inf.v49i20.10546

[26] Shang W, Huang X. A survey of large language models on generative graph analytics: Query, learning, and applications. IEEE Transactions on Knowledge and Data Engineering. 2025, 37(12): 6799-6819. https://doi.org/10.1109/TKDE.2025.3609877

Authors

  • Fuming Ye College of Computer and Information Engineering, Guizhou University of Commerce, Guiyang 550014, China
  • Wenting Li College of Computer and Information Engineering, Guizhou University of Commerce, Guiyang 550014, China
  • Qiong Zhou College of Computer and Information Engineering, Guizhou University of Commerce, Guiyang 550014, China
  • Jie Ye College of Computer and Information Engineering, Guizhou University of Commerce, Guiyang 550014, China
  • Mengzhu Liu College of Computer and Information Engineering, Guizhou University of Commerce, Guiyang 550014, China

DOI:

https://doi.org/10.31449/inf.v50i15.13987

Keywords:

Structured Query Language; Reinforcement Learning; Graph Transformer; MuZero; Learning-Based Optimizer

Downloads

Published

09/19/2026

How to Cite

Ye, F., Li, W., Zhou, Q., Ye, J., & Liu, M. (2026). GT-Muzero: SQL Query Plan Optimization via Graph Transformers and Model-Based Reinforcement Learning. Informatica, 50(15). https://doi.org/10.31449/inf.v50i15.13987