Learning to read explain

From: Francisco Reyes <lists(at)natserv(dot)com>
To: Pgsql Novice <pgsql-novice(at)postgresql(dot)org>
Subject: Learning to read explain
Date: 2001-11-29 23:03:27
Message-ID: 20011129180034.C2380-100000@zoraida.natserv.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Any good sources on how to properly interpret explain?

For instance I started out with something like:
Hash Join (cost=20279.05..128002.12 rows=1064 width=78)
-> Seq Scan on yhearn yhe (cost=0.00..23058.65 rows=1175565 width=38)
-> Hash (cost=18659.62..18659.62 rows=156970 width=40)
-> Seq Scan on hearn he (cost=0.00..18659.62 rows=156970 width=40)

After looking at my tables and what would be my most restrictive
conditions I got down to:
Nested Loop (cost=0.00..65999.17 rows=21 width=78)
-> Seq Scan on yhearn yhe (cost=0.00..28936.47 rows=7655 width=38)
-> Index Scan using he_horse on hearn he (cost=0.00..4.82 rows=1 width=40)

But it would have helped if I better understood what is the "cost".
Also what is the "Hash" on the first version of my not-optimized query.

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Danny Aldham 2001-11-30 05:30:32 Using temp tables with web apps (No State)
Previous Message Horst Herb 2001-11-29 21:51:06 prevent psql script execution from stopping