Re: probable faq: internal format of numerics

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: probable faq: internal format of numerics
Дата
Msg-id 22801.1145988593@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: probable faq: internal format of numerics  (Brian Hurt <bhurt@janestcapital.com>)
Список pgsql-novice
Brian Hurt <bhurt@janestcapital.com> writes:
> That said, it looks like they're doing a variant of my #2- they're
> holding 5 decimal digits every 2 bytes, plus an extra byte or so for the
> sign.

Four digits per 2 bytes, actually ... five wouldn't fit (99999 > 65535).

> But consider the NumericVar structure defined in numeric.c- is
> one of those stored with every row of a table,

NumericVar is just a transient calculational representation.
NumericData (in numeric.h) is what's stored in the database.  So it's
basically 8 bytes overhead plus 2 bytes for each group of 4 decimal
digits.

            regards, tom lane

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

Предыдущее
От: Brian Hurt
Дата:
Сообщение: Re: probable faq: internal format of numerics
Следующее
От: Ennio-Sr
Дата:
Сообщение: How to obtain algebraic sum of equal lines