Received: from smtp-server3.tampabay.rr.com (smtp-server3.tampabay.rr.com [65.32.1.41]) by postgresql.org (Postfix) with ESMTP id 71AA047594F for ; Sat, 2 Mar 2002 19:27:29 -0500 (EST) Received: from john (6535132hfc203.tampabay.rr.com [65.35.132.203]) by smtp-server3.tampabay.rr.com (8.11.2/8.11.2) with SMTP id g230RS412108 for ; Sat, 2 Mar 2002 19:27:32 -0500 (EST) Message-ID: <001801c1c24a$56369270$cb842341@john> From: "John Oakes" To: Subject: Index doesn't appear to be working. Date: Sat, 2 Mar 2002 19:28:23 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Archive-Number: 200203/22 X-Sequence-Number: 6904 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? This query returns about 5,600 of 10,000 records. It is faster to just do a seq scan because it returns such a high percentage or records? Thanks, I appreciate the help! John Oakes