Tom, your suspicions were correct - ANALYZE was not being run.
I run vacuumdb via a cron script during off hours. After checking the
scripts on both systems, I found that on the system that was not functioning
correctly that the '-z' (analyze) command line option to vacuumdb was
missing. After correcting it and re-running the script, the poorly
performing SQL query takes only a few seconds as opposed to 15 minutes.
Thank you for your help!
[mailto:pgsql-performance-owner(at)postgresql(dot)org]On Behalf Of Tom Lane
Sent: Wednesday, August 25, 2004 3:08 PM
To: Richard Huxton
Cc: David Price; pgsql-performance(at)postgresql(dot)org
Subject: Re: [PERFORM] Optimizer Selecting Incorrect Index
Richard Huxton <dev(at)archonet(dot)com> writes:
> Things to check:
> 1. postgresql.conf settings match - different costs could cause this
> 2. statistics on the two columns (trn_patno,trn_old_date) - if they
> differ considerably between systems that would also explain it.
The different estimated row counts could only come from #2. I suspect
David has forgotten to run ANALYZE on the second system.
I agree that EXPLAIN VERBOSE output is not helpful...
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
message can get through to the mailing list cleanly
In response to
pgsql-performance by date
|Next:||From: Andrew Rawnsley||Date: 2004-08-26 12:07:42|
|Subject: Re: Anyone familiar with Apple Xserve RAID|
|Previous:||From: Richard Huxton||Date: 2004-08-26 10:17:34|
|Subject: Re: Optimizer Selecting Incorrect Index|