pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Greg Stark <gsstark@mit.edu>
Cc: Mark Kirkwood <markir@paradise.net.nz>
Cc: Luke Lonergan <llonergan@greenplum.com>
Cc: stange@rentec.com, Dave Cramer <pg@fastcrypt.com>
Cc: Joshua Marsh <icub3d@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Hardware/OS recommendations for large databases (
Date: Thu, 24 Nov 2005 11:25:28 -0500
Message-ID: <14286.1132849528@sss.pgh.pa.us> (raw)
In-Reply-To: <87d5kqkpd2.fsf@stark.xeocode.com>
References: <BFAAB702.1460D%llonergan@greenplum.com>
	<438583C8.4050809@paradise.net.nz>
	<87d5kqkpd2.fsf@stark.xeocode.com>

Greg Stark <gsstark@mit.edu> 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).

			regards, tom lane



view thread (173+ messages)  latest in thread

Message-ID: <14286.1132849528@sss.pgh.pa.us>
Permalink:  ../14286.1132849528@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/14286.1132849528@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, gsstark@mit.edu, markir@paradise.net.nz, llonergan@greenplum.com, pg@fastcrypt.com, icub3d@gmail.com
  Subject: Re: Hardware/OS recommendations for large databases (
  In-Reply-To: <14286.1132849528@sss.pgh.pa.us>

* 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