Learning Execution Plan Embeddings for Multi-Dimensional Query Resource Prediction
Abstract
Multi-cluster query engines are common in production, but routing queries to appropriately-sized clusters remains an unsolved problem. Current approaches like round-robin, hash-based routing, or manual rules waste resources when simple queries land on oversized clusters and cause failures when complex queries hit undersized ones. Production systems experience resource mismatch failures, requiring manual workarounds such as migrating problematic queries to separate engines. We address this with a system for intelligent cluster sizing using learned execution plan embeddings to predict query resource requirements. Instead of analyzing query text, we vectorize execution plan structure and search for similar historical queries, predicting memory, Central Processing Unit (CPU) and runtime based on actual past performance rather than unreliable optimizer estimates. We employ a tiered inference strategy that supports fast, feature-based vectors (10 basic dimensions; 13–23 ms overhead), gradient boosting with enhanced features (24 dimensions; 76.5% accuracy), and graph neural network embeddings for complex queries (78.1% accuracy). An adaptive classifier maps predictions to cluster sizes using thresholds that adjust based on observed utilization patterns. Unfamiliar queries are routed conservatively, and the system automatically improves from observed outcomes. Empirical validation on 2,954 queries from a Trino deployment shows 98.8–99.8% within-one-size accuracy and 74.8–76.5% exact-match routing. In benchmark workloads, our approach reduces out-of-memory failures by 82% and infrastructure costs by 33%, with less than 51 ms of routing overhead. Gradient boosting achieves 76.5% accuracy, while graph neural networks reach 78.1% for complex join structures.
Fields of Study & Subjects
Software System Performance and Reliability
Cloud Computing and Resource Management
Cognitive Computing and Networks
Publication details
- Journal / source
- IEEE Access
- Publisher
- Institute of Electrical and Electronics Engineers (IEEE)
- Volume
- 14
- Pages
- 37131–37150
- Publication date
- 1 January 2026
- Language
- EN