Re: reducing NUMERIC size for 9.1 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: reducing NUMERIC size for 9.1
Date
Msg-id 19060.1280513299@sss.pgh.pa.us
Whole thread Raw
In response to Re: reducing NUMERIC size for 9.1  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: reducing NUMERIC size for 9.1
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> ....  Maybe something like this,
> obviously with a suitable comment which I haven't written yet:

>     numeric_digits = (precision + 6) / 4;
>     return (numeric_digits * sizeof(int16)) + NUMERIC_HDRSZ;

This is OK for the base-10K case, but there's still code in there
for the base-10 and base-100 cases.  Can you express this logic in
terms of DEC_DIGITS and sizeof(NumericDigit) ?  I think you might
find it was actually clearer that way, cf Polya.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: gincostestimate
Next
From: Tom Lane
Date:
Subject: Re: reducing NUMERIC size for 9.1