Re: New version of money type

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: Theo Schlossnagle <jesus(at)omniti(dot)com>
Cc: Jim C(dot) Nasby <jimn(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: New version of money type
Date: 2006-09-16 23:31:27
Message-ID: 87odtfwfqo.fsf@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Theo Schlossnagle <jesus(at)omniti(dot)com> writes:

> Would that pose indexing issues? It would also mean that when joining two
> tables you'd have to handle some interesting type conversion issues (at
> times). We had someone accidentally create a largish table with userid as
> "numeric" and other tables are "bigint", it was disastrous for performance
> (joining). I'd imagine that if the above wasn't done cleverly, that
> performance problem would be repeated.

That used to be a problem but Tom solved it a little while back. Not a perfect
solution in that it requires lots of cross-data-type operators as the number
of data types grows but it works.

In any case I think Jim was suggesting this be handled internally to the
numeric data type which wouldn't cause this problem. However I'm not sure
anything has to be done. A numeric is an array of 16 bit integers, so anything
under 64k *is* stored just as an integer.

Well, just an integer plus a useless exponent. I think it would be a neat
trick to normalize the exponent to the end of the last element of the mantissa
rather than the first digit so that integers don't need an exponent.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2006-09-16 23:34:28 Re: The enormous s->childXids problem
Previous Message Gregory Stark 2006-09-16 23:21:07 Re: [HACKERS] Developer's Wiki