OntoTune: Ontology-Driven Learning for Query Optimization with Convolutional Models
Songhui Yue, Yang Shao, Sean Hayes
TL;DR
OntoTune addresses the challenge of query optimization under long-tail and environment-sensitive workloads by introducing an ontology-driven platform that encodes queries, plans, and execution context as a knowledge graph. It bootstraps learning by embedding ontology-derived features into a CNN-based reward predictor and uses a Reward-Cost Complement Transform to stabilize online learning and arm selection, while remaining compatible with tree- and graph-based models. The approach provides end-to-end provenance, enabling reproducibility and explainability, and demonstrates potential performance gains over a PostgreSQL baseline in case studies, albeit with seed- and environment-dependent variability. The work highlights a modular pathway toward robust learned query optimization, with future directions including tail-aware ontology expansion, environment-transfer learning, and integration with GCN/GAT and LLM-assisted template discovery for broader generalization.
Abstract
Query optimization has been studied using machine learning, reinforcement learning, and, more recently, graph-based convolutional networks. Ontology, as a structured, information-rich knowledge representation, can provide context, particularly in learning problems. This paper presents OntoTune, an ontology-based platform for enhancing learning for query optimization. By connecting SQL queries, database metadata, and statistics, the ontology developed in this research is promising in capturing relationships and important determinants of query performance. This research also develops a method to embed ontologies while preserving as much of the relationships and key information as possible, before feeding it into learning algorithms such as tree-based and graph-based convolutional networks. A case study shows how OntoTune's ontology-driven learning delivers performance gains compared with database system default query execution.
