Table of Contents
Fetching ...

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.

OntoTune: Ontology-Driven Learning for Query Optimization with Convolutional Models

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.

Paper Structure

This paper contains 18 sections, 12 equations, 5 figures, 1 table.

Figures (5)

  • Figure 1: A Partial Knowledge Graph for DB Query Optimization (with Ontology and Instance Examples)
  • Figure 2: OntoTune's system architecture: developed based on Bao's workflow marcus2021bao.
  • Figure 3: Partial Embedding of the OntoTune Ontology: for an SQL query
  • Figure 4: Queries vs Time for PostgreSQL and OntoTune with Random Set (42).
  • Figure 5: Queries vs Time for PostgreSQL and OntoTune with Random Set (49).