Re: Understanding EXPLAIN ANALYZE output - Mailing list pgsql-general

From Tom Lane
Subject Re: Understanding EXPLAIN ANALYZE output
Date
Msg-id 20558.1107985972@sss.pgh.pa.us
Whole thread Raw
In response to Re: Understanding EXPLAIN ANALYZE output  ("Ed L." <pgsql@bluepolka.net>)
List pgsql-general
"Ed L." <pgsql@bluepolka.net> writes:
> If the second number of the "actual time" part means time
> elapsed in this node and its children until the last row was
> returned, why does it say "actual time=4.63..4.63" instead of
> "actual time=4.63..4767.62"?

The reason we do that is to make the "actual" numbers comparable to the
way that the estimated costs are presented.  The estimated costs are for
a single execution of the node, but the inner side of a nestloop join is
re-executed for each row coming from the outer side.  In this case, the
outer side produced 1014 rows so we ran 1014 separate executions of the
inner indexscan.  If we just reported 4767.62 as the total time, it
would look like the estimated indexscan cost of 10.28 was completely out
of whack, which it isn't.  So instead, we report a per-execution cost
and a "loops" number that you have to multiply by if you are thinking
about total time spent.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Postgresql and Macintosh
Next
From: "Van Ingen, Lane"
Date:
Subject: FOR vs Cursors