Re: [HACKERS] Decimal64 and Decimal128

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: [HACKERS] Decimal64 and Decimal128
Дата
Msg-id CA+Tgmob4JZbGv2tY43CwvNbBNi99dPbivb2nT95xH4WuPvrQLQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] Decimal64 and Decimal128  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [HACKERS] Decimal64 and Decimal128  (Peter Geoghegan <pg@bowt.ie>)
Список pgsql-hackers
On Mon, Jun 19, 2017 at 12:18 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> It would be interesting to get some handle on the performance differences
> between decNumber and our existing NUMERIC implementation.  I'm a little
> skeptical that they'd be so enormous as to make this an interesting
> project, but I could be wrong.

I've never been very happy with the performance of numeric, so I guess
I'm a bit more optimistic about the chances of doing better.  Aside
from any computational optimizations, the fact that the datatype could
be pass-by-value rather than a varlena might speed things up quite a
bit in some cases.

On the other hand, the 8-byte version has a decent chance of being
larger on disk than the numeric representation - e.g. $123,456.78 is
only 7 bytes as a short varlena, and won't induce padding out to the
next 8-byte boundary.  And it looks to me like the 4-byte version
can't represent that quantity at all.  That combination of facts seems
like a big problem to me.   A decimal representation that can't handle
more than 7 digits is going to unsuitable for many applications, and
being bigger than our existing numeric on disk for many
commonly-represented values would be awful.

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



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: [HACKERS] WIP: Data at rest encryption
Следующее
От: Artus de benque
Дата:
Сообщение: Re: [HACKERS] [BUGS] Postgresql bug report - unexpected behavior of suppress_redundant_updates_trigger