Learning to Optimize Join Queries With Deep Reinforcement Learning

08/09/2018
by   Sanjay Krishnan, et al.
0

Exhaustive enumeration of all possible join orders is often avoided, and most optimizers leverage heuristics to prune the search space. The design and implementation of heuristics are well-understood when the cost model is roughly linear, and we find that these heuristics can be significantly suboptimal when there are non-linearities in cost. Ideally, instead of a fixed heuristic, we would want a strategy to guide the search space in a more data-driven way---tailoring the search to a specific dataset and query workload. Recent work in deep reinforcement learning (Deep RL) may provide a new perspective on this problem. Deep RL poses sequential problems, like join optimization, as a series of 1-step prediction problems that can be learned from data. We present our deep RL-based DQ optimizer, which currently optimizes select-project-join blocks, and we evaluate DQ on the Join Order Benchmark. We found that DQ achieves plan costs within a factor of 2 of the optimal solution on all cost models and improves on the next best heuristic by up to 3×. Furthermore, DQ executes 10,000× faster than exhaustive enumeration and more than 10× faster than left/right-deep enumeration on the largest queries in the benchmark.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
11/26/2019

Join Query Optimization with Deep Reinforcement Learning Algorithms

Join query optimization is a complex task and is central to the performa...
research
02/28/2022

Efficient Massively Parallel Join Optimization for Large Queries

Modern data analytical workloads often need to run queries over a large ...
research
03/04/2019

Opportunistic View Materialization with Deep Reinforcement Learning

Carefully selected materialized views can greatly improve the performanc...
research
07/21/2023

JoinGym: An Efficient Query Optimization Environment for Reinforcement Learning

In this paper, we present JoinGym, an efficient and lightweight query op...
research
02/28/2018

Deep Reinforcement Learning for Join Order Enumeration

Join order selection plays a significant role in query performance. Many...
research
01/05/2022

Balsa: Learning a Query Optimizer Without Expert Demonstrations

Query optimizers are a performance-critical component in every database ...
research
07/21/2020

Buffer Pool Aware Query Scheduling via Deep Reinforcement Learning

In this extended abstract, we propose a new technique for query scheduli...

Please sign up or login with your details

Forgot password? Click here to reset