X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 88B15DBA4C for ; Thu, 24 Nov 2005 12:40:28 -0400 (AST) 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 64887-06 for ; Thu, 24 Nov 2005 16:40:26 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from stark.xeocode.com (stark.xeocode.com [216.58.44.227]) by svr1.postgresql.org (Postfix) with ESMTP id E59F2DBA3F for ; Thu, 24 Nov 2005 12:40:25 -0400 (AST) Received: from localhost ([127.0.0.1] helo=stark.xeocode.com) by stark.xeocode.com with smtp (Exim 3.36 #1 (Debian)) id 1EfK8z-0003u4-00; Thu, 24 Nov 2005 11:40:21 -0500 To: Tom Lane Cc: Greg Stark , Mark Kirkwood , Luke Lonergan , stange@rentec.com, Dave Cramer , Joshua Marsh , pgsql-performance@postgresql.org Subject: Re: Hardware/OS recommendations for large databases ( References: <438583C8.4050809@paradise.net.nz> <87d5kqkpd2.fsf@stark.xeocode.com> <14286.1132849528@sss.pgh.pa.us> In-Reply-To: <14286.1132849528@sss.pgh.pa.us> From: Greg Stark Organization: The Emacs Conspiracy; member since 1992 Date: 24 Nov 2005 11:40:21 -0500 Message-ID: <877jayknii.fsf@stark.xeocode.com> Lines: 15 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[AWL=0.000] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200511/500 X-Sequence-Number: 15757 Tom Lane writes: > Greg Stark writes: > > Last I heard the reason count(*) was so expensive was because its state > > variable was a bigint. That means it doesn't fit in a Datum and has to be > > alloced and stored as a pointer. And because of the Aggregate API that means > > it has to be allocated and freed for every tuple processed. > > There's a hack in 8.1 to avoid the palloc overhead (courtesy of Neil > Conway IIRC). ah, cool, missed that. -- greg