>> >> > One more problem with low ndistinct values is that the condition might >> >> > very well >> >> > hit no rows at all. But Idea 1 will largely overestimate the number of >> >> > hits. >> >> Thats a good point, but I don't see a clear solution. Maybe we could > > I think that MCVs are the solution, right?
Only if they cover the entire range of values in the table. > A low ndistinct means that those values will likely be MCVs. Yes, but I don't think thats the point. If we query on values that aren't in the table, the planner will always overestimate the expected number of returned rows because it ( implicitly ) assumes that every query will return at least 1 record. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers