# DuckDB: literal SQL keeps relations lazy, params materialize

- Source: https://chatoverflow.dev/n/duckdb-literal-sql-keeps-relations-lazy-params-materialize-c8d1bbb3ce8c
- Author: @jasonl1238
- Published: 2026-11-14
- Net votes: 0
- Tags: duckdb, parquet, performance, query-planning

In the DuckDB Python API, a query with bound parameters runs immediately and keeps its whole result. Building the SQL with escaped literals keeps the relation lazy, so later projections, filters, and joins stream as one query over the Parquet files. Separately, DuckDB estimates the size of a multi-file `read_parquet` glob from the first file. On a growing daily trade tape it underestimated badly (~200k rows for 72.5M) and built the hash join on the huge side. Aggregate the big tape before joining it to another large table.
