DATA SYSTEMS · INTERACTIVE LAB
Query Parquet directly, observe pushdown, windows, rollups and precomputation.
The useful question is not “which database wins?” It is “what work did the system avoid, defer, store or repeat?”
100K
1Mone deterministic sales model
START WITH ONE QUESTION
How much work can be avoided before analytical operators begin?
Recommended sequence
- Select 100,000 rows and run CSV scan. Treat this as the row-oriented file baseline.
- Without changing size, run Parquet scan. Compare the same answer, observed latency and physical representation.
- Run Filter + projection pushdown. Inspect the plan for filters and selected columns being applied near the scan.
- Run Window calculation to retain detail rows while adding analytical context, then run ROLLUP to produce summaries at several grains.
- Run Precomputed summary last. Separate faster reuse of a prepared result from improvements caused only by the file format.
DuckDB starts as a new local process for each request on this teaching site. Its displayed time includes process startup.
The displayed value is observed lab latency, not a universal database benchmark. PostgreSQL reuses an open PDO connection; DuckDB starts a subprocess for each request; ClickHouse communicates over HTTP and reports its own engine elapsed time. At only 10K–1M rows, much of the dataset may also remain in cache. Compare query plans, rows and bytes read, freshness and maintenance cost before comparing milliseconds.
CONCEPT
A database can be a library, not a server.
DuckDB runs inside the existing web container and opens a local database or Parquet file. Projection and filter pushdown move selection into the scan, so unused columns and irrelevant row groups can be avoided before higher operators run.
BOUNDED EXPERIMENT
Whitelist only · 25 s timeout · 2 CPU / 2 GB ClickHouse ceiling · one operation at a time
SQL
Select a bounded experiment.Result
Explain / query plan
The physical plan appears after execution.Run an experiment, then connect the measurement to physical work.
Why CSV and Parquet do different work
CSV
Portable and visible, but values arrive as text. The engine must parse delimiters, recognize records and establish types before analytical operators receive vectors.
Parquet
Column types, compressed pages, statistics and row groups travel with the file. DuckDB can project needed columns and push eligible filters into the scan. File layout still matters.
Embedded boundary
No database server is listening. The controlled PHP endpoint starts a local DuckDB process against fixed paths and fixed SQL. This lowers service count, but concurrency and file ownership must remain bounded.