"John Watts" <jwatts@xxxxxxxxxxxxxxxxxxxx> writes: > Anyone? I'm still suspicious that you're not really re-ANALYZE'ing the relevant tables, because there are some discrepancies in the row count estimates that seem hard to explain otherwise, eg here: -> Index Scan using tblcompanyindidnumber on tblcompany (cost=0.00..8.40 rows=1 width=206) (actual time=0.003..0.003 rows=0 loops=3445) Index Cond: (tblappliccomp.companyid = tblcompany.idnumber) vs -> Bitmap Heap Scan on tblcompany (cost=13.07..1774.92 rows=620 width=185) (actual time=0.013..0.013 rows=0 loops=3445) Recheck Cond: (tblappliccomp.companyid = tblcompany.idnumber) -> Bitmap Index Scan on tblcompanyindidnumber (cost=0.00..12.91 rows=620 width=0) (actual time=0.011..0.011 rows=0 loops=3445) Index Cond: (tblappliccomp.companyid = tblcompany.idnumber) That might be caused by missing stats for either tblcompany or tblappliccomp. Or perhaps the problem is much different values of default_statistics_target? Also, I've got to say that this does not represent good practice: > server_version | 8.3.0 You're missing eighteen minor-release updates on that server. We don't do minor releases just to keep ourselves amused; there are a lot of rather significant bug fixes that you're missing, possibly including some that affect this issue. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general