Received: from jupiter.hub.org (jupiter.hub.org [64.49.215.5]) by postgresql.org (Postfix) with ESMTP id 97B06475E29; Fri, 15 Mar 2002 13:06:06 -0500 (EST) Received: (from news@localhost) by jupiter.hub.org (8.11.6/8.11.6) id g2FHcXB55201; Fri, 15 Mar 2002 11:38:33 -0600 (CST) (envelope-from news) From: Dmitry Tkach X-Newsgroups: comp.databases.postgresql.sql, comp.databases.postgresql.novice, comp.databases.postgresql.general Subject: Why is it not using an index? Date: Fri, 15 Mar 2002 14:07:44 -0500 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 36 Message-ID: <3C924680.4090806@openratings.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: news@hub.org User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.7+) Gecko/20020123 X-Accept-Language: en-us To: pgsql-general@postgresql.org.pgsql-sql@postgresql.org X-Archive-Number: 200203/833 X-Sequence-Number: 22205 This must be really simple, but I just can't get it :-( I have a table (a) with a single column (x): Table "a" Attribute | Type | Modifier -----------+----------+---------- x | smallint | Index: a_idx Index "a_idx" Attribute | Type -----------+---------- x | smallint btree The table has 10000000 rows.... Now, how come, when I do: explain select * from a where x=3; it says: Seq Scan on bset (cost=100000000.00..100175934.05 rows=303 width=2) Why is it not using a_idx??? I even tried set enable_seqscan to off - makes no difference :-( Any idea what is going on? Thanks a lot! Dima