Re: How to evaluate "explain analyze" correctly soon after "explain" for the same statement ? - Mailing list pgsql-general

From Tom Lane
Subject Re: How to evaluate "explain analyze" correctly soon after "explain" for the same statement ?
Date
Msg-id 8285.1352300127@sss.pgh.pa.us
Whole thread Raw
In response to How to evaluate "explain analyze" correctly soon after "explain" for the same statement ?  (高健 <luckyjackgao@gmail.com>)
Responses Re: How to evaluate "explain analyze" correctly soon after "explain" for the same statement ?  (高健 <luckyjackgao@gmail.com>)
List pgsql-general
=?UTF-8?B?6auY5YGl?= <luckyjackgao@gmail.com> writes:
> It might not be a big problem in a small system.
> But when in a production environment,  When I  want to use explain  and
> then , soon use explain analyze for the same statement,
> How can I avoid the influence of cache and get the right answer for
> evaluating purpose?

I think this question is based on a false premise.  Why do you feel that
the behavior with cold caches is "the right answer", and not the behavior
with warm caches?  A short-duration query like this one is not going to
be interesting at all for performance unless it's executed quite a lot,
and if it's executed quite a lot then the warm-cache result ought to be
the more representative one.

In general, trying to tune for cold-cache cases seems backwards to me.
It's much more productive to try to ensure that the caches are warm.

            regards, tom lane


pgsql-general by date:

Previous
From: "Albe Laurenz"
Date:
Subject: Re: How to evaluate "explain analyze" correctly soon after "explain" for the same statement ?
Next
From: Jeff Janes
Date:
Subject: Re: Unexpectedly high disk space usage