Re: difference in query plan when db is restored

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "John Watts" <jwatts(at)promotion-update(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: difference in query plan when db is restored
Date: 2012-05-18 16:29:25
Message-ID: 25719.1337358565@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"John Watts" <jwatts(at)promotion-update(dot)com> 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Steve Crawford 2012-05-18 17:09:49 Re: odd intermittent query hanging issue
Previous Message Aaron Burnett 2012-05-18 16:17:34 odd intermittent query hanging issue