Traditional SQL query optimizers rely heavily on rule-based or cost-estimation models, which often produce suboptimal execution plans under complex multi-join or nested query scenarios. To address these limitations, we propose GQO, a Graph Neural Network-based Query Optimizer that transforms execution plans into graph structures and leverages both GCN and GAT to model operator dependencies and semantic relationships. GQO generates query embeddings for accurate execution time prediction and produces optimization hints that can be injected into PostgreSQL for real-world performance gains. Experimental results on TPC-H queries demonstrate that GQO significantly outperforms traditional Cost Models, MLP baselines, and Tree-LSTM models, achieving over 26% average performance improvement.
한국어
기존 SQL 쿼리 최적화 프로그램은 규칙 기반 또는 비용 추정 모델에 크게 의존하는데, 이는 복잡한 다중 조인 또는 중첩 쿼리 시나리오에서 종종 최적이 아닌 실행 계획을 생성한다. 이러한 한계를 해결하기 위해, 실행 계획을 그래프 구조로 변환하고 GCN과 GAT를 활용하여 연산자 종속성과 의미 관계를 모델링하 는 그래프 신경망 기반 쿼리 최적화 프로그램인 GQO를 제안한다. GQO는 정확한 실행 시간 예측을 위한 쿼리 임베딩을 생성하고, PostgreSQL에 삽입하여 실제 성능 향상을 위해 사용할 수 있는 최적화 힌트를 생 성한다. TPC-H 쿼리에 대한 실험 결과는 GQO가 기존 비용 모델, MLP 베이스라인, 그리고 Tree-LSTM 모 델보다 훨씬 뛰어난 성능을 보이며 평균 26% 이상의 성능이 향상되었다.
목차
Abstract 요약 1. Introduction 2. Related Works 2.1 Current Status of SQL Query Optimization Based on Deep Learning 2.2 Related Methods for Query Optimization 3. Graph-based Query Optimization System 3.1 Overview 3.2 System Architecture 3.3 GQO Model Establishment and Training 4. Evaluation and Result 4.1 Experimental Method 4.2 Performance Evaluation 5. Conclusions REFERENCES