🦆🤓
When Denis Hirn implemented DuckDB’s first recursive CTE operator in 2020, correctness determined the design: evaluate the non-recursive term once, then evaluate the recursive term until the next working table is empty.
That established the right semantic contract, but reusable runtime state was scoped too narrowly. In the upcoming DuckDB v2.0 release, we assign those scopes explicitly.
#
DuckDB’s# recursive CTE engine now treats recursion as one long-lived computation: it retains eligible epoch-invariant state, chooses execution modes from exact frontier cardinalities and physical work, probes keyed state directly and gives `USING KEY ... UNION` changed-key semantics.
Read more in this preview of the forthcoming v2.0 release: