David Blewett <david@xxxxxxxxxxxxxxxx> writes: > I took the time to load this data into an 8.4beta2 install, and the same > query runs in a much more reasonable timeframe (~3s as opposed to ~50s). I > set the statistics target to 500, and got this explain [1]. > 1. http://explain.depesz.com/s/pw Hmm... the join size estimates are no better than before, so I'm afraid that 8.4 is just as vulnerable to picking a bad plan as the previous versions were. I don't think you should assume anything's been fixed. It still feels like this schema design is obscuring correlations that the planner needs to know about in order to make decent estimates. You mentioned earlier that the seemingly unrelated question_ids were linked via a common submission_id. I wonder whether it's possible to query using the submission_id instead? regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance