Re: New version of money type - Mailing list pgsql-hackers

From Andrew - Supernews
Subject Re: New version of money type
Date
Msg-id slrneglgq1.2ea3.andrew+nonews@atlantis.supernews.net
Whole thread Raw
In response to New version of money type  ("D'Arcy J.M. Cain" <darcy@druid.net>)
Responses Re: New version of money type  ("D'Arcy J.M. Cain" <darcy@druid.net>)
Re: New version of money type  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
On 2006-09-15, "D'Arcy J.M. Cain" <darcy@druid.net> wrote:
> On Fri, 15 Sep 2006 10:17:55 -0000
> Andrew - Supernews <andrew+nonews@supernews.com> wrote:
>> Presumably the same speed as bigint, which is to say that while it is
>> faster than numeric for calculation, it is (much) slower for input/output.
>> (The difference in speed between bigint output and numeric output is
>> measured in multiples, not in percentages.)
>
> I/O for money seems at least as compareable to numeric if not slightly
> better.

Seems? Have you benchmarked it?

> Other than that it has all the speed advantages as bigint for
> basically the same reasons.  It's basically bigint with modified input
> and output functions.

The point is that bigint is _not_ faster than numeric for I/O (in fact
even integer is not faster than numeric for output).

Numbers from an actual benchmark:

int4out(0)     - 0.42us/call
numeric_out(0) - 0.32us/call

int4out(1000000000)     - 0.67us/call
numeric_out(1000000000) - 0.42us/call

For numbers at the top end of bigint's range, the speed difference is on
the order of 4x (albeit on my 32-bit machine)

-- 
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services


pgsql-hackers by date:

Previous
From: "Albe Laurenz"
Date:
Subject: Re: [PATCHES] Linking on AIX (Was: Fix linking of OpenLDAP libraries )
Next
From: Tom Lane
Date:
Subject: Re: [PATCHES] Linking on AIX (Was: Fix linking of OpenLDAP libraries )