Skip site navigation (1) Skip section navigation (2)

Re: reducing NUMERIC size for 9.1

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: reducing NUMERIC size for 9.1
Date: 2010-07-30 18:08:19
Message-ID: 19060.1280513299@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Robert Haas <robertmhaas(at)gmail(dot)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

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2010-07-30 18:11:05
Subject: Re: reducing NUMERIC size for 9.1
Previous:From: Robert HaasDate: 2010-07-30 18:03:59
Subject: Re: gincostestimate

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group