[Paper Review] Practical MCTS-based Query Optimization: A Reproducibility Study and new MCTS algorithm for complex queries
This paper reproduces AlphaJoin and HyperQO, reveals reproducibility issues with learned MCTS cost models, and introduces a new MCTS-based join optimization method that uses the database’s internal cost model with Extreme UCT for robustness, showing improved performance on complex joins.
Monte Carlo Tree Search (MCTS) has been proposed as a transformative approach to join-order optimization in database query processing, with recent frameworks such as AlphaJoin and HyperQO claiming to outperform traditional methods. However, the fact that these frameworks rely on learned cost models raises concerns related to generalizability and deployment readiness. This paper presents a comprehensive reproducibility study of these methods, revealing that they often fail to support the claimed performance gains when subjected to diverse workloads. Through an ablation study, we diagnose the root cause of this instability: while the MCTS search strategy is effective, the accompanying learned cost models suffer from severe out-of-distribution generalization errors. Addressing this, we propose a novel MCTS framework. Unlike prior methods that rely on unstable learned components, our approach utilizes the database standard internal cost model, augmented by a new Extreme UCT (Upper Confidence Bound applied to Trees) selection policy to navigate the search space more robustly. We benchmark our method against the original AlphaJoin and HyperQO, as well as industry-standard baselines including Dynamic Programming (DP) and Genetic Query Optimization (GEQO), using the well-known Join Order Benchmark (JOB) and the new JOB-Complex benchmark. The results demonstrate that our approach outperforms learned MCTS methods and achieves superiority over a SOTA query optimizer in complex join scenarios on real-world data. We release the full implementation and experimental artifacts to support further research.
Motivation & Objective
- Evaluate reproducibility of existing MCTS-based join order optimizers (AlphaJoin and HyperQO) on standard benchmarks.
- Diagnose root causes of instability and generalization failures in learned cost models.
- Propose a robust, reproducible MCTS-based JOO approach leveraging the DBMS cost model and Extreme UCT.
- Benchmark the proposed method against DP/GEQO, AlphaJoin, and HyperQO on JOB and JOB-Complex datasets.
Proposed method
- Reproduce AlphaJoin and HyperQO with available code and artifacts integrated into PostgreSQL via planner hints.
- Conduct ablation study to distinguish effects of MCTS search vs. learned cost models.
- Develop a new two-stage prefix-guided MCTS algorithm that uses the database’s internal cost model and Extreme UCT for robust search (Algorithm 1).
- Implement an external Python controller that generates join-order hints and rewrites SQL to enforce proposed plans, enabling DBMS integration without core changes.
- Evaluate on JOB (113 queries) and JOB-Complex benchmarks, including larger queries (≥12 relations) and out-of-sample tests.

Experimental results
Research questions
- RQ1Do AlphaJoin and HyperQO produce reproducible performance gains on JOB and JOB-Complex benchmarks under controlled reproduction settings?
- RQ2What are the reproducibility barriers (code availability, integration challenges, hardware requirements) for learned MCTS-based optimizers in practice?
- RQ3Can a robust, fully reproducible MCTS-based join optimization method outperform learned MCTS approaches and traditional optimizers on complex queries?
- RQ4How does integrating MCTS with a DBMS internal cost model (using Extreme UCT) compare to learned cost models in terms of robustness and scalability?
- RQ5Is it beneficial to combine GEQO/DP as starting points for MCTS refinements on large join instances?
Key findings
- Reproducibility of AlphaJoin and HyperQO is limited; code availability and DBMS integration pose significant challenges.
- AlphaJoin results were not consistently better than PostgreSQL on JOB, and could not be evaluated on JOB-Complex due to training/generator issues.
- HyperQO showed stability on JOB but failed to improve on JOB-Complex (100% default plans for new queries).
- A novel two-stage prefix-guided MCTS using Extreme UCT with the DBMS internal cost model achieves superior performance on complex joins compared to traditional optimizers and prior MCTS methods, especially for queries with 12+ relations.
- The proposed method, implemented as an external control loop with SQL rewriting and optimizer hints, avoids altering core DBMS components and enables reproducible experimentation.
- On JOB and JOB-Complex benchmarks, AlphaJoin/HyperQO results did not consistently surpass PostgreSQL; the new MCTS algorithm demonstrated wins in complex scenarios and when starting from GEQO plans.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.