Arrow Research search
Back to RLC

RLC 2024

JoinGym: An Efficient Join Order Selection Environment

Conference Paper RLC accepted paper Artificial Intelligence · Machine Learning · Reinforcement Learning

Abstract

Join order selection (JOS), the ordering of join operations to minimize query execution cost, is a core NP-hard combinatorial optimization problem in database query optimization. We present \textsc{JoinGym}, a lightweight and easy-to-use reinforcement learning (RL) environment that captures both left-deep and bushy variants of the JOS problem. Compared to prior works that execute queries online, \textsc{JoinGym} has much higher throughput and efficiently simulates the cost of joins offline by looking up the intermediate table's cardinality from a pre-computed dataset. We provide such a cardinality dataset for $3300$ queries based on real IMDb workloads, which is the largest suite its kind and may be of independent interest. We extensively benchmark several RL algorithms and find that the best policies are competitive with or better than Postgres, a strong non-learning baseline. However, the learned policies can still catastrophically fail on a small fraction of queries which motivates future research using \textsc{JoinGym} to improve generalization and safety in long-tailed, partially observed, combinatorial optimization problems.

Authors

Keywords

No keywords are indexed for this paper.

Context

Venue
Reinforcement Learning Conference
Archive span
2024-2025
Indexed papers
228
Paper id
739119678286481511
v2026.09.13