X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id F2CEAD1B4F4 for ; Mon, 27 Oct 2003 17:57:16 +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 96468-04 for ; Mon, 27 Oct 2003 13:56:45 -0400 (AST) Received: from smtp.istop.com (dci.doncaster.on.ca [66.11.168.194]) by svr1.postgresql.org (Postfix) with ESMTP id F191FD1B515 for ; Mon, 27 Oct 2003 13:56:44 -0400 (AST) Received: from stark.dyndns.tv (gsstark.mtl.istop.com [66.11.160.162]) by smtp.istop.com (Postfix) with ESMTP id 33A4236929; Mon, 27 Oct 2003 12:56:45 -0500 (EST) Received: from localhost ([127.0.0.1] helo=stark.dyndns.tv ident=foobar) by stark.dyndns.tv with smtp (Exim 3.36 #1 (Debian)) id 1AEBbh-0005IK-00; Mon, 27 Oct 2003 12:56:45 -0500 To: Neil Conway Cc: Greg Stark , Dror Matalon , PostgreSQL Performance Subject: Re: Various performance questions References: <20031026194449.GD2979@rlx11.zapatec.com> <87u15vxrue.fsf@stark.dyndns.tv> <1067269309.459.33.camel@tokyo> In-Reply-To: <1067269309.459.33.camel@tokyo> From: Greg Stark Organization: The Emacs Conspiracy; member since 1992 Date: 27 Oct 2003 12:56:44 -0500 Message-ID: <877k2qy36r.fsf@stark.dyndns.tv> Lines: 18 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/685 X-Sequence-Number: 4433 Neil Conway writes: > On Sun, 2003-10-26 at 22:49, Greg Stark wrote: > > What version of postgres is this?. In 7.4 (and maybe 7.3?) count() uses an > > int8 to store its count so it's not limited to 4 billion records. > > Unfortunately int8 is somewhat inefficient as it has to be dynamically > > allocated repeatedly. > > Uh, what? Why would an int8 need to be "dynamically allocated > repeatedly"? Perhaps I'm wrong, I'm extrapolating from a comment Tom Lane made that profiling showed that the bulk of the cost in count() went to allocating int8s. He commented that this could be optimized by having count() and sum() bypass the regular api. I don't have the original message handy. -- greg