X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 0B782D1C4C9 for ; Wed, 30 Jul 2003 12:48:39 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 52344-10 for ; Wed, 30 Jul 2003 09:47:40 -0300 (ADT) Received: from relay05.indigo.ie (relay05.indigo.ie [194.125.133.229]) by svr1.postgresql.org (Postfix) with SMTP id F3C9DD1C4E7 for ; Wed, 30 Jul 2003 09:48:36 -0300 (ADT) Received: (qmail 90503 messnum 1438908 invoked from network[193.120.145.156/unknown]); 30 Jul 2003 12:48:39 -0000 Received: from unknown (HELO tcd.ie) (193.120.145.156) by relay05.indigo.ie (qp 90503) with SMTP; 30 Jul 2003 12:48:39 -0000 Message-ID: <3F27BE36.2090508@tcd.ie> Date: Wed, 30 Jul 2003 13:46:46 +0100 From: Tim McAuley User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-general@postgresql.org Subject: Unused Indexes Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/1452 X-Sequence-Number: 46305 Hi, I have a table which I have populated with over 5000 entries. There is a combined index placed on two of the columns (both bigint). I am trying a simple select (i.e. select id where col1 = 1 and col2 = 1) covering these two columns and it keeps using a seq scan. Is this correct? I would have thought that with this number of entries that an index scan should be used. I am testing this using postgresql 7.3.3 on windows 2000 using cygwin. Doing "set enable_seqscan to off" does not change the results of the explain operation. I also tried setting a single index on just one of the columns and running an appropriate search; it still uses a seq scan. At what stage will the planner normally start using an index scan? Any hints appreciated. Tim