Tagged articles
1 articles
Page 1 of 1
dbaplus Community
dbaplus Community
Sep 19, 2017 · Databases

Why PostgreSQL Misestimates Rows When Types Are Cast – and How to Fix It

A recent production issue showed that PostgreSQL dramatically over‑estimated row counts because filter predicates performed implicit type casts, leading to sequential scans and 18‑second queries, but correcting column types or rewriting the predicates restored accurate estimates and reduced execution time to under a second.

Index ScanPostgreSQLQuery Planning
0 likes · 8 min read
Why PostgreSQL Misestimates Rows When Types Are Cast – and How to Fix It