Analyze makes queries slow... - Mailing list pgsql-performance

From Stef
Subject Analyze makes queries slow...
Date
Msg-id 20030811155841.483ffd93.svb@ucs.co.za
Whole thread Raw
Responses Re: Analyze makes queries slow...
Re: Analyze makes queries slow...
List pgsql-performance
Hi all,

I posted this problem on the sql list, and was referred to this list in stead.
I have attached an sql statement that normally runs under 3 minutes.
That is, until I vacuum analyze the database (or just the tables in the query),
then the same query runs longer than 12 hours, and I have to kill it.

However 90% of queries are faster after analyzing on this database,
there are two or three, including this one that takes for ever.

I have tried to reverse engineer the explain plan from before analyzing,
to come up with an sql statement, using proper joins, to force the planner
to do the original join, but although I came close, I never got the same
result as the original query.

I suspect that this might be caused by some of the crazy indexes that
were built on some of these tables, but I can't really do much about that,
unless I can come up with a very good reason to nuke them.

I also attached the "create table" statements for all the tables, as well
as a row count of each.

Can somebody help me with guidelines or something similar,
to understand exactly what is happening in the explain plan.

TIA
Stefan


Attachment

pgsql-performance by date:

Previous
From: "Shridhar Daithankar"
Date:
Subject: Re: Peformance of Update
Next
From: "scott.marlowe"
Date:
Subject: Re: Perfomance Tuning