Re: Reduce NUMERIC size by 2 bytes, reduce max length to 508 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Reduce NUMERIC size by 2 bytes, reduce max length to 508
Date
Msg-id 26325.1133848960@sss.pgh.pa.us
Whole thread Raw
In response to Re: Reduce NUMERIC size by 2 bytes, reduce max length to 508  (Michael Fuhr <mike@fuhr.org>)
Responses Re: Reduce NUMERIC size by 2 bytes, reduce max length to 508
List pgsql-hackers
Michael Fuhr <mike@fuhr.org> writes:
> On Mon, Dec 05, 2005 at 11:59:10PM -0500, Bruce Momjian wrote:
>> Tom Lane wrote:
>>> The question remains, though, is this computational range good for
>>> anything except demos?
>> 
>> I can say that the extended range is good for finding *printf problems.  ;-)

> Might anybody be calculating permutations or combinations with the
> textbook functions that use factorials?

Hm ... between that, the possible crypto connection, and John's personal
testimony that he actually uses PG for calculations in this range, I'm
starting to lean to the idea that we shouldn't cut the range.

We could get the same 2-byte savings (in fact 3 bytes on average,
considering alignment issues) by implementing a 2-byte length word
format for numeric.  I had originally hoped to do both things to save
an average 5 bytes per numeric, which is starting to get to the point of
actually being interesting ;-).  But maybe we should just do the part
that we can do without removing any user-visible functionality.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: Reduce NUMERIC size by 2 bytes, reduce max length to 508
Next
From: Christopher Kings-Lynne
Date:
Subject: inet to bigint?