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 2B8F53CC2F4 for ; Fri, 17 Dec 2004 23:55:54 +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 26414-04 for ; Fri, 17 Dec 2004 23:55:48 +0000 (GMT) Received: from cassarossa.samfundet.no (cassarossa.samfundet.no [129.241.93.19]) by svr1.postgresql.org (Postfix) with ESMTP id ACA393CC2A9 for ; Fri, 17 Dec 2004 23:55:49 +0000 (GMT) Received: from trofast.sesse.net ([129.241.93.32]) by cassarossa.samfundet.no with esmtp (Exim 4.34) id 1CfRwq-0003iy-Qn for pgsql-performance@postgresql.org; Sat, 18 Dec 2004 00:55:49 +0100 Received: from sesse by trofast.sesse.net with local (Exim 3.36 #1 (Debian)) id 1CfRwq-0004ke-00 for ; Sat, 18 Dec 2004 00:55:48 +0100 Date: Sat, 18 Dec 2004 00:55:48 +0100 From: "Steinar H. Gunderson" To: pgsql-performance@postgresql.org Subject: Re: Seqscan rather than Index Message-ID: <20041217235548.GD16149@uio.no> Mail-Followup-To: pgsql-performance@postgresql.org References: <20041217011853.9E8FF3CADB0@svr1.postgresql.org> <41C2D936.3060901@archonet.com> <87acsdkjte.fsf@stark.xeocode.com> <20041217215627.GC8281@uio.no> <20041217220907.GA10313@uio.no> <20041217170229.4de276a7.frank@wiles.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041217170229.4de276a7.frank@wiles.org> X-Operating-System: Linux 2.6.8.1 on a i686 User-Agent: Mutt/1.5.6+20040907i 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/234 X-Sequence-Number: 9609 On Fri, Dec 17, 2004 at 05:02:29PM -0600, Frank Wiles wrote: > 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. Like I said, all in cache, so no disk IO. count(*) and count(1) give me identical results. (BTW, I don't think this is a count problem, it's a "sequential scan" problem -- I'm just trying to find out if this is natural or not, ie. if this is just something I have to expect in a relational database, even with no I/O.) /* Steinar */ -- Homepage: http://www.sesse.net/