Index doesn't appear to be working.

From: "John Oakes" <john(at)networkproductions(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Index doesn't appear to be working.
Date: 2002-03-01 20:41:17
Message-ID: NHRf8.10874$TV4.1590523@typhoon.tampabay.rr.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a table with a column titled 'passfail' that only contains either a P
for pass or an F for fail. The table name is 'one'. I created the index on
the table with:

CREATE INDEX one_passfail_idx ON one USING btree (passfail);

I then do:

VACUUM ANALYZE one;

Then I do an explain on this query:

SELECT * FROM one where passfail = 'P';

and it tells me:

Seq Scan on one (cost=0.00..263.02 rows=5613 width=56)

Shouldn't it tell me

Index Scan using one_passfail_idx on one?

Why isn't it using the index? Thanks, I appreciate the help!

John Oakes

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Cornelia Boenigk 2002-03-01 21:10:50 Qestion about CREATE FUNCTION
Previous Message Chris Gamache 2002-03-01 20:37:02 improving performance of UNION and ORDER BY