Re: why does count take so long? - Mailing list pgsql-general

From Tom Lane
Subject Re: why does count take so long?
Date
Msg-id 4269.1063057668@sss.pgh.pa.us
Whole thread Raw
In response to Re: why does count take so long?  (Greg Stark <gsstark@mit.edu>)
Responses Re: why does count take so long?
Re: why does count take so long?
List pgsql-general
Greg Stark <gsstark@mit.edu> writes:
> Things like count(*) could use int4 until it overflows though.

I don't see a reasonable way for an aggregate to change state datatype
on the fly; otherwise this would be a great solution.

> Is int4 a pass-by-value datatype on 32-bit machines?

Yeah.  Not too long ago, count() used int4, but we got some complaints
about it overflowing on big tables.

            regards, tom lane

pgsql-general by date:

Previous
From: Ron Johnson
Date:
Subject: Re: About GPL and proprietary software
Next
From: Greg Stark
Date:
Subject: Re: Can I use PostgreSQL to develop a self-organizing