db.l3.ai

Play

lessons

what-changed-in-19

editor

engine: not started

results

Run a query to see rows here.

check

Bad estimate

The planner multiplies the selectivities of separate columns as if they were independent. skew(a, b) has b = a, so it underestimates badly.

task

skew(a, b) has b = a. Run EXPLAIN (ANALYZE) on WHERE a = 1 AND b = 1, compare estimated and actual rows, then return the actual row count.

hints