Tom Lane wrote:
Hmm. One of the things that's on my TODO list is to make the planner smarter about drilling down into sub-selects to extract statistics. I think that's what's called for here, but your example has eliminated all the interesting details. Can you show us the actual query, its EXPLAIN plan, and the definitions of the tables/views involved?
I've already altered the queries that ran into this problem. I'll dig the old ones out of CVS and send them to you tomorrow. -- todd