How D <scp>uck</scp> DB is USING KEY to Unlock Recursive Query Performance

SQL's recursive common table expressions (CTEs) can express complex computations over tabular data. Their accumulative semantics---which collects all intermediate results in a union table---may incur substantial space and runtime overhead, however. This paper takes the recently proposed USING KEY variant of recursive CTEs as a starting point and demonstrates it as a production-ready feature in DuckDB. This CTE variant admits queries to selectively ''overwrite'' prior intermediate results, which ultimately leads to substantially smaller union tables and runtime savings. We present the changes we made to DuckDB to support this new CTE form and showcase the performance of the USING KEY variant using the LDBC graph instances. The demonstration features a fully functional implementation of USING KEY in a DuckDB instance, pre-loaded with LDBC graphs, and a large set of queries that demonstrate the benefits. The demonstration will be interactive, allowing attendees to play with sample SQL queries and data.

Authors

Institutions

Publication Details

Published
2025-06-17
DOI
https://doi.org/10.1145/3722212.3725107
Citations
1
Primary Topic
Advanced Database Systems and Queries
Type
article
Field-Weighted Citation Impact
1.49
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

How D uck DB is USING KEY to Unlock Recursive Query Performance

Denis Hirn, Torsten Grust, Björn Bamberg
1 citations
Advanced Database Systems and Queries
1.49
article

How D uck DB is USING KEY to Unlock Recursive Query Performance

Denis Hirn, Torsten Grust, Björn Bamberg
article en
1 citations

Abstract

SQL's recursive common table expressions (CTEs) can express complex computations over tabular data. Their accumulative semantics---which collects all intermediate results in a union table---may incur substantial space and runtime overhead, however. This paper takes the recently proposed USING KEY variant of recursive CTEs as a starting point and demonstrates it as a production-ready feature in DuckDB. This CTE variant admits queries to selectively ''overwrite'' prior intermediate results, which ultimately leads to substantially smaller union tables and runtime savings. We present the changes we made to DuckDB to support this new CTE form and showcase the performance of the USING KEY variant using the LDBC graph instances. The demonstration features a fully functional implementation of USING KEY in a DuckDB instance, pre-loaded with LDBC graphs, and a large set of queries that demonstrate the benefits. The demonstration will be interactive, allowing attendees to play with sample SQL queries and data.

University of Tübingen (DE)
Openalex Percentile: Top 16%
Advanced Database Systems and Queries
1.49
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.