Re: query has huge variance in execution times - Mailing list pgsql-performance

From David Wilson
Subject Re: query has huge variance in execution times
Date
Msg-id e7f9235d1003311144i5cf86e6cw67cc6540ec6cd6f8@mail.gmail.com
Whole thread Raw
In response to Re: query has huge variance in execution times  (Brian Cox <brian.cox@ca.com>)
List pgsql-performance


On Wed, Mar 31, 2010 at 2:10 PM, Brian Cox <brian.cox@ca.com> wrote:


so the question still remains: why did it take > 20 mins? To see if it was due to autovacuum running ANALYZE, I turned off autovacuum, created a table using SELECT * INTO temp FROM ts_stats_tranunit_user_daily, added the index on ts_interval_start_time and ran the prepared query with temp, but the query completed in a few secs.

It's possible that statistics were updated between the >20 minute run and your most recent prepared query test. In fact, comparing the plans between your two emails, it's quite likely, as even the non-prepared versions are not producing the same plan or the same estimates; it's therefore possible that your problem has already corrected itself if you're unable to duplicate the 20 minute behaviour at this point.

Taking a look at the statistics accuracy with an explain analyze might still be informative, however.

--
- David T. Wilson
david.t.wilson@gmail.com

pgsql-performance by date:

Previous
From: Brian Cox
Date:
Subject: Re: query has huge variance in execution times
Next
From: Scott Carey
Date:
Subject: Re: Database size growing over time and leads to performance impact