by tschellenbach · 5mo ago · 0 comments
This is the main thing the planner doesn't handle well. Postgres was built before SAAS was as big. You have different distributions per customer, and thousands of customers. In most cases the query planner will guess right, but sometimes it will fail and scan millions of rows.
https://www.postgresql.org/docs/current/planner-stats.html#P...