Re: Fixed length data types issue

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: Fixed length data types issue
Дата
Msg-id 87pse2ovh3.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Re: Fixed length data types issue  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Fixed length data types issue
Re: Fixed length data types issue
Список pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> writes:

> Gregory Stark <stark@enterprisedb.com> writes:
> > At first I meant that as a reductio ad absurdum argument, but, uh,
> > come to think of it why *do* we have our own arbitrary precision
> > library? Is there any particular reason we can't use one of the
> > existing binary implementations?
> 
> Going over to binary storage would trade off I/O speed for calculation
> speed, which is probably not a win for everyone; 

Huh? Which would you expect binary to be worse at than decimal? I would expect
it to be both faster and denser.

> and even more seriously, how are you going to represent decimal fractions
> exactly? The fact that 0.01 is 0.01 and not just a near approximation
> thereto is critical for a lot of our users.

Certainly any arbitrary precision library isn't worth beans if it can't
represent values accurately.

I'm not sure how gmp and the others represent their data but my first guess is
that there's no particular reason the base of the mantissa and exponent have
to be the same as the base the exponent is interpreted as. That is, you can
store a base 10 exponent but store it and the mantissa in two's complement
integers.

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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Fixed length data types issue
Следующее
От: mark@mark.mielke.cc
Дата:
Сообщение: Re: Fixed length data types issue