Database Research Group

WSI – Database Systems Research Group

PgCuckoo — Laying Plan Eggs Into PostgreSQL's Nest

Denis Hirn, Torsten Grust

Proceedings of the 38th ACM SIGMOD Int'l Conference on the Management of Data (SIGMOD 2019), Amsterdam, The Netherlands, June 2019.

Online version

We demonstrate how to use PostgreSQL's planner hook to open a side entrance through which we can pass plan trees for immediate execution. Since this reaches deep into PostgreSQL, we implement plan detail inference and decoration to ensure that externally crafted trees perfectly mimic regular plans. Plan trees may then

  1. be generated by external code generators that want to use PostgreSQL as a reliable and efficient back-end for new (maybe even non-relational) languages, or
  2. stem from experimental rewrites of SQL plans that PostgreSQL itself does not implement (yet).

The demonstration provides a live account of what becomes possible once we let PostgreSQL hatch foreign plan eggs.