Re: [HACKERS] Datatype MONEY - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Datatype MONEY
Date
Msg-id 11872.945101510@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] Datatype MONEY  (Michael Meskes <meskes@postgreSQL.org>)
List pgsql-hackers
Michael Meskes <meskes@postgreSQL.org> writes:
> BTW could anyone tell me how exactly NUMERIC is stored? Just for curiosity.

I believe it's a simple-minded BCD format, one decimal digit per byte.

Jan has been muttering about reimplementing it as radix-10000, storing
four decimal digits per short instead of one per byte; that'd reduce
the number of iterations in the inner calculation loops by 4x, without
making the elementary steps noticeably more expensive on modern hardware...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] update_pg_pwd
Next
From: Gunther Schadow
Date:
Subject: Re: [HACKERS] Datatype MONEY