pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Stark <gsstark@mit.edu>
To: Neil Conway <neilc@samurai.com>
Cc: Greg Stark <gsstark@mit.edu>
Cc: Dror Matalon <dror@zapatec.com>
Cc: PostgreSQL Performance <pgsql-performance@postgresql.org>
Subject: Re: Various performance questions
Date: 27 Oct 2003 12:56:44 -0500
Message-ID: <877k2qy36r.fsf@stark.dyndns.tv> (raw)
In-Reply-To: <1067269309.459.33.camel@tokyo>
References: <20031026194449.GD2979@rlx11.zapatec.com>
	<87u15vxrue.fsf@stark.dyndns.tv>
	<1067269309.459.33.camel@tokyo>

Neil Conway <neilc@samurai.com> 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




view thread (23+ messages)  latest in thread

Message-ID: <877k2qy36r.fsf@stark.dyndns.tv>
Permalink:  ../877k2qy36r.fsf@stark.dyndns.tv/
Also on:    postgresql.org/message-id/877k2qy36r.fsf@stark.dyndns.tv

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: gsstark@mit.edu, neilc@samurai.com, dror@zapatec.com
  Subject: Re: Various performance questions
  In-Reply-To: <877k2qy36r.fsf@stark.dyndns.tv>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox