Michael Meskes <meskes(at)postgreSQL(dot)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