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 990F2D1C4D5 for ; Wed, 30 Jul 2003 13:50:54 +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 61010-02 for ; Wed, 30 Jul 2003 10:49:56 -0300 (ADT) Received: from MRS.ISPserver.BlackBerry.NET (BBP44.blackberry.net [206.51.26.44]) by svr1.postgresql.org (Postfix) with ESMTP id 6B6D5D1C4CB for ; Wed, 30 Jul 2003 10:50:52 -0300 (ADT) Content-type: text/plain Date: Wed, 30 Jul 2003 09:49:54 -0400 From: "EDMUND DENGLER" Importance: Normal MIME-Version: 1.0 Reply-To: "EDMUND DENGLER" Subject: Re: Unused Indexes To: mcauleyt@tcd.ie To: pgsql-general@postgresql.org Message-Id: <20030730135052.6B6D5D1C4CB@svr1.postgresql.org> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/1458 X-Sequence-Number: 46311 You need to convert the int's to bigints. select id where col1 = 1::bigint and col2 = 1::bigint Regards, Ed -----Original Message----- From: Tim McAuley Date: Wed, 30 Jul 2003 13:46:46 To:pgsql-general@postgresql.org Subject: [GENERAL] Unused Indexes 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 ---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster