DuckPL: A procedural language in DuckDB
summary
DuckPL implements a Postgres‑dialect PL/pgSQL front end stored as rows in a DuckDB table with serialized blobs, a tree‑walk interpreter that uses an explicit heap‑based stack so table‑valued functions can pause and stream chunks, and an expression executor fast path that evaluates SQL expressions directly — yielding about 30× speedup on a loop example versus naïve query execution. Current runtime is single‑threaded, row‑by‑row, supports variables, loops, cursors (basic), and printf debugging, not yet open source; compilation-to-SQL and hybrid execution are planned.
AI-written summary · about
chapters (18)
- 0:00Introduction to DuckPL
- 2:10DuckPL UDF example
- 3:45Live demo of DuckPL
- 4:54DuckPL architecture
- 5:55Parsing PL/pgSQL
- 6:43AST transformation
- 7:48Universal representation
- 9:33Persistent storage
- 10:52Execution engine
- 12:24Streaming and operator fit
- 13:40Infinite function demo
- 15:01Combining UDFs
- 16:35Expression fast-path
- 17:58Current features
- 18:59Future work
- 22:19Compilation to SQL
- 24:01Vision and CLI
- 25:17Q&A and conclusion
related talks
21mWhat can Postgres learn from DuckDB?
24mpg_duckdb: Ducking awesome analytics in Postgres
19mIn-Process Analytical Data Management with DuckDB
40mDuckDB: Harnessing in-process analytics for data science and beyond
40mDuckDB beyond the notebook
27mIn Process Analytical Data Management with DuckDB
34mData Wrangling with DuckDB
30mDuckDB: Bringing analytical SQL directly to your Python shell
