Rows Removed by Filter: Proof the Engine Read Rows It Threw Away
EXPLAIN ANALYZE reports, for each step, how many rows it tested and discarded, as 'Rows Removed by Filter'. A step that returns 12 rows after removing 4,000,000 read four million rows to give you twelve, which is the definition of a query doing too much work. The distinction to watch is Index Cond versus Filter: a condition in Index Cond narrowed the search, while a condition in Filter was checked only after the rows were fetched. Learning to read that split tells you exactly which part of your WHERE clause the index actually served.
Questions this Concept answers
Why is a condition appearing under `Filter` worse news than the same condition appearing under `Index Cond`?
J
jeremy
Video
Reading a PostgreSQL Query Plan with EXPLAIN ANALYZE to Compare Estimated and Actual Rows
A relational database's cost-based query planner chooses an execution strategy that is invisible in the SQL text itself, and `EXPLAIN` / `EXPLAIN ANALYZE` exposes that choice as an execution plan: `E…