Re: Understanding EXPLAIN ANALYZE output

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Ed L(dot)" <pgsql(at)bluepolka(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Understanding EXPLAIN ANALYZE output
Date: 2005-02-09 21:52:52
Message-ID: 20558.1107985972@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Ed L." <pgsql(at)bluepolka(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Van Ingen, Lane 2005-02-09 21:55:45 FOR vs Cursors
Previous Message Tom Lane 2005-02-09 21:40:57 Re: Postgresql and Macintosh