Re: Numeric performances

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Vincenzo Romano <vincenzo(dot)romano(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Numeric performances
Date: 2007-06-04 14:35:38
Message-ID: 19101.1180967738@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Vincenzo Romano <vincenzo(dot)romano(at)gmail(dot)com> writes:
> It sounds quite strange to me that numeric is faster than bigint.

This test is 100% faulty, because it fails to consider the fact that the
accumulator used by sum() isn't necessarily the same type as the input
data. In fact we sum ints in a bigint and bigints in a numeric to avoid
overflow.

If you try it with max() you'd likely get less-surprising answers.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Madison Kelly 2007-06-04 14:36:29 Re: High-availability
Previous Message Ron St-Pierre 2007-06-04 14:34:13 Re: [Fwd: Re: Autovacuum keeps vacuuming a table disabled in pg_autovacuum]