Re: reducing NUMERIC size for 9.1

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: reducing NUMERIC size for 9.1
Date: 2010-07-29 21:25:10
Message-ID: AANLkTinKngSbVfqKi=BG2KHHYSRs6NuyDeoHuVacEo1O@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jul 29, 2010 at 5:03 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> OK.  I think you're misinterpreting the point of that comment, which
>> may mean that it needs some clarification.  By "the two byte header
>> format is also used", I think I really meant "the header (and in fact
>> the entire value) is just 2 bytes".  Really, the low order bits have
>> neither the old interpretation nor the new interpretation: they don't
>> have any interpretation at all - they're completely meaningless.
>> That's what the part after the word "but" was intended to clarify.
>> Every routine in numeric.c checks for NUMERIC_IS_NAN() and gives it
>> some special handling before doing anything else, so NUMERIC_WEIGHT()
>> and NUMERIC_DSCALE() are never called in that case.
>
> I would suggest the comment ought to read something like
>
>        NaN values also use a two-byte header (in fact, the
>        whole value is always only two bytes).  The low order bits of
>        the header word are available to store dscale, though dscale
>        is not currently used with NaNs.

I can do something along those lines, though I'm reluctant to mention
dscale specifically since we have no agreement that such a thing makes
sense, or is the only/best use for those bits. Did you look at the
patch to move the numeric stuff out of the .h file that I attached a
few emails back? If that looks OK, I can commit it and then redo the
rest of this along the lines we've discussed.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Vincenzo Romano 2010-07-29 21:30:00 Re: On Scalability
Previous Message Tom Lane 2010-07-29 21:03:43 Re: reducing NUMERIC size for 9.1