Re: query has huge variance in execution times

From: David Wilson <david(dot)t(dot)wilson(at)gmail(dot)com>
To: Brian Cox <brian(dot)cox(at)ca(dot)com>
Cc: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: query has huge variance in execution times
Date: 2010-03-31 18:44:44
Message-ID: e7f9235d1003311144i5cf86e6cw67cc6540ec6cd6f8@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Wed, Mar 31, 2010 at 2:10 PM, Brian Cox <brian(dot)cox(at)ca(dot)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(dot)t(dot)wilson(at)gmail(dot)com

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Scott Carey 2010-03-31 20:37:15 Re: Database size growing over time and leads to performance impact
Previous Message Brian Cox 2010-03-31 18:10:53 Re: query has huge variance in execution times