X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 44A9FD1DCF7 for ; Sat, 29 Nov 2003 17:37:45 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 33286-08 for ; Sat, 29 Nov 2003 13:37:19 -0400 (AST) Received: from megazone.bigpanda.com (megazone.bigpanda.com [64.147.171.210]) by svr1.postgresql.org (Postfix) with ESMTP id 359A0D1DBB3 for ; Sat, 29 Nov 2003 13:37:12 -0400 (AST) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 883A73528B; Sat, 29 Nov 2003 09:37:12 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 86C0835093; Sat, 29 Nov 2003 09:37:12 -0800 (PST) Date: Sat, 29 Nov 2003 09:37:12 -0800 (PST) From: Stephan Szabo To: ow Cc: pgsql-sql@postgresql.org Subject: Re: Seq Scans when index expected to be used In-Reply-To: <20031129164924.51035.qmail@web21401.mail.yahoo.com> Message-ID: <20031129093428.R75231@megazone.bigpanda.com> References: <20031129164924.51035.qmail@web21401.mail.yahoo.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/343 X-Sequence-Number: 16158 On Sat, 29 Nov 2003, ow wrote: > Am trying to find duplicate values in a large table (about 80M records). > Somehow, none of the two (2) queries (see below) is using the index "I_bca" > that, I believe, should've been used. As a side note, to help determine if it should be used, you probably want explain analyze not just explain. In general the index is only going to help you if the sort is very expensive, not for the initial scan (where the seq scan is generally faster).