Labs
Each lab takes under an hour on a laptop and turns a claim from this mechanism into a number you measured yourself.
- 1
Estimate versus actual on a correlated filter
A PostgreSQL table where postcode implies city: the row estimate against the actual count, with per-column statistics, dependencies and an MCV list.
Real systemDocker, Python - 2
Join elimination with and without an enforced constraint
PostgreSQL removes a LEFT JOIN to a unique key it does not need; an inner join stays. Then an unenforced key and an orphan row change the answer.
Real systemDocker, Python - 3
Find the index-versus-scan crossover on your machine
Force index and sequential scans across selectivities from 0.01% to 50%, on clustered and shuffled data, and compare with what the planner picks.
Real systemDocker, Python - 4
A partition with no statistics
Load a new day into a partitioned PostgreSQL table and compare the plan before and after ANALYZE on that partition alone.
Real systemDocker, Python - 5
Cross the dynamic-programming cliff
Plan joins of 8 to 16 tables in a chain and a star with PostgreSQL's exhaustive search and with GEQO; count distinct plans.
Real systemDocker, Python - 6
Four pairs of equal queries
NOT IN against NOT EXISTS with a NULL, a function on a partition key against a range, and a CTE materialized or not, in PostgreSQL.
Real systemDocker, Python - 7
Min/max skipping on sorted versus unsorted data
10 million store_ids in Parquet, random and sorted: how many of 100 row groups a filter must read, and what one outlier does.
MeasurePython with PyArrow - 8
Pushdown and projection: count the bytes
DuckDB on Parquet: a filter on sorted and random files, all columns against one, and a filter wrapped in an expression.
MeasurePython with DuckDB - 9
Top-N heap against full sort
The top 100 of 20 million numbers with a sort and with a heap; then a PostgreSQL LIMIT that makes the plan worse.
Real systemDocker, Python - 10
Bloom filter size and false-positive rate
Bloom filters for a million keys at 5, 10 and 15 bits per key: false-positive rate and size.
MeasurePython with NumPy - 11
Late materialization crossover
Filter a 100-million-element array with a boolean mask and with a position list, across selectivities, and find where gathering loses.
MeasurePython with NumPy - 12
Parameter sniffing in PostgreSQL
A prepared statement on a 95%/0.002% skewed column: custom plans, generic plans, and when PostgreSQL switches between them.
Real systemDocker, Python