EXPLAIN ANALYZE output

From: David Rysdam <drysdam(at)ll(dot)mit(dot)edu>
To: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: EXPLAIN ANALYZE output
Date: 2005-12-27 18:58:46
Message-ID: 43B18EE6.3020208@ll.mit.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm afraid I still don't understand the output of EXPLAIN ANALYZE. The
output I get is like this:

blah blah blah (cost=A..B blah blah) (actual time=C..D blah blah)

According to what I've been able to find:

A = predicted time to first returned row in milliseconds
B = total cost in arbitrary units
C = actual time to first returned row in milliseconds
D = actual total time in milliseconds

1) Is this correct?

I had a query that was taking a long time and I spent the last day and a
half trying to reduce D. I probably should have been working on
reducing C, but that's neither here nor there. Nothing I've done has
had any appreciable effect, with both C and D staying around
170000-200000 (~= 3 minutes), including dropping the sort condition.
After all this head-on-wall banging, I went back and tried doing the
query without EXPLAIN ANALYZE. It takes under a minute, even with the
sort turned on.

2) Does EXPLAIN ANALYZE add a lot of overhead that is being measured here?

3) Even if so, why has the output of EXPLAIN ANALYZE not dropped even
though the query itself is now faster (due to something I did while
working on C/D?)?

There's been plenty of vacuuming and analyzing on these tables, so
outdated stats are not the answer.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joshua D. Drake 2005-12-27 20:56:21 Re: EXPLAIN ANALYZE output
Previous Message Michael Fuhr 2005-12-27 18:04:38 Re: Problem creating stored procedure