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 4DEB7D1D6B9 for ; Sat, 29 Nov 2003 17:29:08 +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 31950-06 for ; Sat, 29 Nov 2003 13:28:42 -0400 (AST) Received: from joeconway.com (66-146-172-86.skyriver.net [66.146.172.86]) by svr1.postgresql.org (Postfix) with ESMTP id 58689D1B521 for ; Sat, 29 Nov 2003 13:28:36 -0400 (AST) Received: from [192.168.5.3] (account jconway HELO joeconway.com) by joeconway.com (CommuniGate Pro SMTP 4.1.8) with ESMTP-TLS id 691892; Sat, 29 Nov 2003 09:26:27 -0800 Message-ID: <3FC8D6D3.2030504@joeconway.com> Date: Sat, 29 Nov 2003 09:26:43 -0800 From: Joe Conway User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 To: jasiek Cc: ow , pgsql-sql@postgresql.org Subject: Re: Seq Scans when index expected to be used References: <20031129164924.51035.qmail@web21401.mail.yahoo.com> <20031129170913.M37199@klaster.net> In-Reply-To: <20031129170913.M37199@klaster.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/342 X-Sequence-Number: 16157 jasiek wrote: > On Sat, 29 Nov 2003 08:49:24 -0800 (PST), ow wrote > >>explain select b, c, a >>from test >>group by b, c, a >>having count(*) > 1 Why would you expect this to use an index scan when it needs to read the entire table? If you read the whole table (or even a significant fraction of it), a seq scan is faster. Joe