Re: Is it bug???

From: Rod Taylor <rbt(at)rbt(dot)ca>
To: Bruno Wolff III <bruno(at)wolff(dot)to>
Cc: Ringo <no(at)email(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Is it bug???
Date: 2003-09-05 13:33:41
Message-ID: 1062768819.66151.4.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, 2003-09-05 at 09:18, Bruno Wolff III wrote:
> On Wed, Sep 03, 2003 at 23:19:24 -0700,
> Ringo <no(at)email(dot)com> wrote:
> > What a prick..
>
> >From observing Tom's responses here, I think this is a real question (not
> an RTFM response). If the documentation doesn't make it clear to new readers
> that explain analyze does execute the query (though doesn't return the
> results), then the documentation needs to get fixed.

I see 3 places on the EXPLAIN page that states ANALYZE queries are
executed. Perhaps it should be noted elsewhere, but it is well described
in the "SQL Commands" section of the docs.

One with the ANALYZE keyword under 'Inputs':
Flag to carry out the query and show actual run times.

One in the description:
The ANALYZE option causes the query to be actually executed, not
only planned. The total elapsed time expended within each plan
node (in milliseconds) and total number of rows it actually
returned are added to the display. This is useful for seeing
whether the planner's estimates are close to reality.

Finally, one in a big CAUTION block near the bottom of the description:

Keep in mind that the query is actually executed when ANALYZE is
used. Although EXPLAIN will discard any output that a SELECT
would return, other side-effects of the query will happen as
usual. If you wish to use EXPLAIN ANALYZE on an INSERT, UPDATE,
or DELETE query without letting the query affect your data, use
this approach:

BEGIN;
EXPLAIN ANALYZE ...;
ROLLBACK;

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Stephan Szabo 2003-09-05 14:01:12 Re: Unclear documentation (IMMUTABLE functions)
Previous Message Bruno Wolff III 2003-09-05 13:18:13 Re: Is it bug???