Re: Numeric patch to add special-case representations for < 8 bytes

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: Numeric patch to add special-case representations for < 8 bytes
Дата
Msg-id 87tzx5u2go.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Re: Numeric patch to add special-case representations for < 8 bytes  (Patric Bechtel <bechtel@ipcon.de>)
Ответы Re: Numeric patch to add special-case representations for < 8 bytes  (Patric Bechtel <bechtel@ipcon.de>)
Re: Numeric patch to add special-case representations for < 8 bytes  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
"Patric Bechtel" <bechtel@ipcon.de> writes:

> Maybe you want to have a look here:
> http://www2.hursley.ibm.com/decimal/DPDecimal.html

Well we're not really looking for the optimal packing in general. All the
problems here have to do with convenience in the implementation rather than
the problems with the approach. It's easier in the code to have fixed size
scale and weight and to have them at the beginning of the data type, which is
fine for larger values but for small values they dominate and waste space.

But as far as the approach goes, I admit I find it a bit hard to believe that
we're still doing BCD in the 21st century at all.

If we stored the digits in base 2 with a base 10 exponent would it really be
too hard to output the digits? Even long multiplication and then reversing the
results doesn't seem like it would be too bad and surely there must exist
reasonable algorithms to do better.

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

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: xpath_array with namespaces support
Следующее
От: Patric Bechtel
Дата:
Сообщение: Re: Numeric patch to add special-case representations for < 8 bytes