Fig 4: PostBOUND
What is PostBOUND? PostBOUND is a Python-based framework designed to specifically the said reproducibility gaps stated above. Unlike traditional methods that require deep C-level patching of Postgres kernel, PostBOUND allows researchers to prototype entirely in Python. Looking at the workflow, PostBOUND hooks into the database using a “hinting module” by generating a specific execution plan and forces the database to follow it using extensions like “pg_hint_plan” or the advanced “pg_lab”.
In the scenario that a researcher is studying only Join Ordering, he does not need to build a full optimizer as PostBOUND automatically provides “sensible defaults” for cardinality estimation and cost modelling to complete the pipeline.
Since PosBOUND is written in Python, it integrates seamlessly with modern ML ecosytems like Pandas or Scikit-learn making it more easier to test optimizers like MSCN or BAO without going encountering the version specific patch issues.
The end to end workflow of PostBOUND can be summarized in the following steps: ### Query Preparation -> Query Optimization(Fill the Gaps stage) -> Query Hinting -> Benchmarking -> Result Analysis.
PostBOUND does not only provide technical advantages but also has some non-funtional benefits such as;
- Easy to use.
- Provides a nice programming experience i.e (low boilerplate, high customizability and powerful abstractions).
- Allows for fast onboarding as it provides many optimization algorithms out of the box.
- Uses sensible defaults whenever possible therefore achieving low configuration overhead.
- Good documentation.
While traditional methods usually focus on minimizing “q-error”, PostBOUND’s transparent evaluation showed a big disconnect that 36% of improvements in cardinality estimation actually resulted in worse execution runtimes. This allowed researchers to see that marginal improvements often trigger arbitrary and unstable plan jumps where the optimizer switches to a completely different plan that may not be optimal.
“Fill the Gaps” architecture of PostBOUND allowed researchers to leave out specific stages of the optimization pipeline leading to the first join (base join) is the most important decision in exactly 75% if queries.
PostBOUND’s advanced benchmarking allows for testing under real world “noise neighbor” conditions which revealed a plan thought to be perfect in isolation becomes higly inefficient under load.
Take aways and Conclusion
In conclusion, the core message from Professor Lehner is that while query optimization is a 50 year old black art, it still remains a frontier for modern research and the main target for the next generation of researchers is to move away from from isolated non-reproducible research towards a reproducible research artifact and tools like PostBOUND can help achieve this target.
References
Lehner, W. (2025). An Elephant Under the Microscope: On Reproducible Optimizer Research. HPI Lecture Series 2025/2026. Selinger, P., et al. (1979). Access Path Selection in a Relational Database Management System. (The foundational “System R” paper cited as the industry baseline) . Marcus, R., et al. (2021). BAO: Making Learned Query Optimization Practical. (Cited regarding learned models and plan selection) . Kipf, A., et al. (2019). Learned Cardinalities: Estimating Correlated Joins with Deep Learning (MSCN). Hertzschuch, A., et al. (2021). Simplicity Done Right for Join Ordering (UES/Pessimistic Core).