Understanding the output of EXPLAIN ANALYSE

From: "Thurber, Fred" <Fred(dot)Thurber(at)gdit(dot)com>
To: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Understanding the output of EXPLAIN ANALYSE
Date: 2009-07-23 17:14:54
Message-ID: 42FD6908B3553343B8957500E798AABD19B4D93F03@EXCHCCR04.ad.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I am a newbie to PostgreSQL and am a little confused by the execution plan of a query we are working. The SQL does some joins and the resulting plan looked like this:

"Nested Loop (cost=78.63..101.14 rows=1 width=256) (actual time=0.000..16.000 rows=2818 loops=1)"
...
"Total runtime: 16.000 ms"

So the cost was 101. We put indexes on the two tables that were being joined and re-ran EXPLAIN ANALYZE. The cost went way down, but the execution time went way up. What am I missing?

"Nested Loop (cost=0.00..15.28 rows=1 width=256) (actual time=0.000..110.000 rows=2818 loops=1)"
...
"Total runtime: 110.000 ms"

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Michael Swierczek 2009-07-23 19:00:46 SSL root.crt read problem for Postgres 8.4
Previous Message Christopher Browne 2009-07-23 15:44:13 Re: [Slony1-general] Question on Load balancing