Re: Hardware/OS recommendations for large databases ( - Mailing list pgsql-performance

From Greg Stark
Subject Re: Hardware/OS recommendations for large databases (
Date
Msg-id 877jayknii.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: Hardware/OS recommendations for large databases (  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-performance
Tom Lane <tgl@sss.pgh.pa.us> writes:

> 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).

ah, cool, missed that.

--
greg

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: Hardware/OS recommendations for large databases (
Next
From: "Luke Lonergan"
Date:
Subject: Re: Hardware/OS recommendations for large databases (