X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C309D3CC0A3 for ; Fri, 17 Dec 2004 23:01:51 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 10394-05 for ; Fri, 17 Dec 2004 23:01:40 +0000 (GMT) Received: from frank.wiles.org (frank.wiles.org [24.124.39.75]) by svr1.postgresql.org (Postfix) with ESMTP id 3D4DA3CC586 for ; Fri, 17 Dec 2004 23:01:41 +0000 (GMT) Received: from kungfu (frank.wiles.org [24.124.39.75]) by frank.wiles.org (8.12.11/8.12.11) with SMTP id iBI06LDD010427; Fri, 17 Dec 2004 18:06:21 -0600 Date: Fri, 17 Dec 2004 17:02:29 -0600 From: Frank Wiles To: "Steinar H. Gunderson" Cc: pgsql-performance@postgresql.org Subject: Re: Seqscan rather than Index Message-Id: <20041217170229.4de276a7.frank@wiles.org> In-Reply-To: <20041217220907.GA10313@uio.no> References: <20041217011853.9E8FF3CADB0@svr1.postgresql.org> <41C2D936.3060901@archonet.com> <87acsdkjte.fsf@stark.xeocode.com> <20041217215627.GC8281@uio.no> <20041217220907.GA10313@uio.no> X-Mailer: Sylpheed version 0.9.10 (GTK+ 1.2.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200412/233 X-Sequence-Number: 9608 On Fri, 17 Dec 2004 23:09:07 +0100 "Steinar H. Gunderson" wrote: > On Fri, Dec 17, 2004 at 10:56:27PM +0100, Steinar H. Gunderson wrote: > > I'm a bit unsure -- should counting ~3 million rows (no OIDs, PG > > 7.4, everything in cache, 32-byte rows) take ~3500ms on an Athlon 64 > > 2800+? > > (I realize I was a bit unclear here. This is a completely separate > case, not related to the original poster -- I was just wondering if > what I'm seeing is normal or not.) It depends more on your disk IO than the processor. Counting isn't processor intensive, but reading through the entire table on disk is. I've also seen a huge difference between select count(*) and select count(1) in older versions, haven't tried it on a recent version however. --------------------------------- Frank Wiles http://www.wiles.org ---------------------------------