Re: Reduce NUMERIC size by 2 bytes, reduce max length to 508

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, "John D(dot) Burger" <john(at)mitre(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Reduce NUMERIC size by 2 bytes, reduce max length to 508
Date: 2005-12-06 06:02:40
Message-ID: 26325.1133848960@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-patches

Michael Fuhr <mike(at)fuhr(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Maik Troemel 2005-12-06 07:46:16 Re: PG_exception_stack
Previous Message Michael Fuhr 2005-12-06 05:51:12 Re: Reduce NUMERIC size by 2 bytes, reduce max length to 508

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2005-12-06 07:31:59 inet to bigint?
Previous Message Michael Fuhr 2005-12-06 05:51:12 Re: Reduce NUMERIC size by 2 bytes, reduce max length to 508

Browse pgsql-patches by date

  From Date Subject
Next Message Nicolai Tufar 2005-12-06 08:52:24 Re: [PATCHES] snprintf() argument reordering not working under Windows in 8.1
Previous Message Michael Fuhr 2005-12-06 05:51:12 Re: Reduce NUMERIC size by 2 bytes, reduce max length to 508