why sequential scan

From: newsreader(at)mediaone(dot)net
To: pgsql-general(at)postgresql(dot)org
Subject: why sequential scan
Date: 2001-08-16 12:50:12
Message-ID: 20010816085011.A2208@dragon.universe
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Can someone explain why pg is doing
a sequential scan on table item with the following
statement

-----
q=> explain select distinct h.id,i.item,i.heading,i.finish from item i ,body_index h where h.id=i.item and (h.string='book') order by finish;
NOTICE: QUERY PLAN:

Unique (cost=6591.46..6606.51 rows=150 width=24)
-> Sort (cost=6591.46..6591.46 rows=1505 width=24)
-> Hash Join (cost=5323.27..6512.04 rows=1505 width=24)
-> Seq Scan on item i (cost=0.00..964.39 rows=5139 width=20)
-> Hash (cost=5319.51..5319.51 rows=1505 width=4)
-> Index Scan using body_index_string on body_index h (cost=0.00..5319.51 rows=1505 width=4)

---------

"item" table has integer primary key "item". It has
15 or so other columns.

The performance is not very impressive with about
5000 records in item table and 1.5 million record in
body_index and both are supposed to get
much bigger in the real life situation

Is the performance bottle neck that
particular sequential scan?

The database has just been vacuumed.

Thanks in advance

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Carlos Felipe Zirbes 2001-08-16 13:06:01 RE: Roll Back dont roll back counters
Previous Message Roderick A. Anderson 2001-08-16 12:26:55 Re: Roll Back dont roll back counters