Data engineering·Cost, layout and query performance
the plan says it expects nine hundred rows from that filter, it actually returns forty million, and every choice after that is wrong.
Cardinality estimate
Also calledrow estimate, planner estimate
The planner's guess at how many rows each step will produce, from which it picks join algorithms, join order and memory allocations. A bad estimate early in the plan compounds through everything after it, which is why one wrong filter estimate can make an otherwise sensible query catastrophic. Comparing estimated against actual row counts in the plan is the fastest way to find where a query went wrong.