Learning to Optimize Join Queries With Deep Reinforcement Learning

By Sanjay Krishnan, Zongheng Yang, Ken Goldberg, Joseph M Hellerstein, Ion Stoica. 2018

250 citations recorded by the source corpus.

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. Recognizing the link between classical Dynamic Programming enumeration methods and recent results in Reinforcement Learning (RL), we propose a new method for learning optimized join search strategies. We present our RL-based DQ optimizer, which currently optimizes select-project-join blocks. We implement three versions of DQ to illustrate the ease of integration into existing DBMSes: (1) A version built on top of Apache Calcite, (2) a version integrated into PostgreSQL, and (3) a version integrated into SparkSQL. Our extensive evaluation shows that DQ achieves plans with optimization costs and query execution times competitive with the native query optimizer in each system, but can execute significantly faster after learning (often by orders of magnitude).

Subfields: Artificial Intelligence, Computer Networks and Communications

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Artificial Intelligence

  1. Li Fei-Fei
  2. Silvio Savarese
  3. Roberto Mart'in-Mart'in
  4. Danfei Xu
  5. Ajay Mandlekar
  6. Abhinav Kumar Gupta
  7. Philip S. Yu
  8. Yuke Zhu

In Computer Networks and Communications

  1. Johannes Gehrke
  2. Viktor Leis
  3. Hongzi Mao
  4. Mohammad Alizadeh
  5. Peter A. Boncz
  6. Andreas Kipf
  7. Thomas Kipf
  8. Bernhard Radke

Citations in the corpus