From: David Wilson <david.t.wilson@gmail.com>
To: Brian Cox <brian.cox@ca.com>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: query has huge variance in execution times
Date: Wed, 31 Mar 2010 14:44:44 -0400
Message-ID: <e7f9235d1003311144i5cf86e6cw67cc6540ec6cd6f8@mail.gmail.com> (raw)
In-Reply-To: <4BB3902D.7010205@ca.com>
References: <4BB3902D.7010205@ca.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: david.t.wilson@gmail.com, brian.cox@ca.com
Subject: Re: query has huge variance in execution times
In-Reply-To: <e7f9235d1003311144i5cf86e6cw67cc6540ec6cd6f8@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox