Re: why does count take so long?

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Greg Stark <gsstark@mit.edu>
Cc: pgsql-general@postgresql.org
Date: 2003-09-08T21:47:48Z
Lists: 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