D'Arcy,

On 9/28/06 9:00 AM, "Luke Lonergan" <[EMAIL PROTECTED]> wrote:

> Which routines implement the money arithmetic?

Ok - so now having read the old documentation and the routine "
backend/utils/adt/cash.c" and the type definition for Cash in "
backend/include/utils/adt/cash.h" I can see that it's:

- Fixed point at NNN.MM
- Stored as an INT32 (or your proposed INT64)
- Operations use native operands (=<>+*/)

The disappointing thing is that there is always a function call involved in
any arithmetic operation.  An even larger benefit could probably be gained
by inlining the routines in cash.c, which is probably inhibited by the
"FUNCTIONCALLxxx" indirections in the executor for operators (different
topic).

So, the NUMERIC arithmetic must be really slow to get 10% improvements in
computational speed.

Based on all of this, I know I would use the 64 bit money type for things
like the TPC-H benchmark...

- Luke 



---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Reply via email to