Re: probable faq: internal format of numerics

Поиск
Список
Период
Сортировка
От Brian Hurt
Тема Re: probable faq: internal format of numerics
Дата
Msg-id 444E48AC.2060903@janestcapital.com
обсуждение исходный текст
Ответ на Re: probable faq: internal format of numerics  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: probable faq: internal format of numerics  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-novice
Tom Lane wrote:
Brian Hurt <bhurt@janestcapital.com> writes: 
This is probably a FAQ, but I've googled the question and haven't found 
an answer.  What is the internal format of  numerics?   
"Use the source, Luke"
 

This is what I was hoping to not do.  It's generally not possible to understand a peice of a project out of context- even well commented and well structured code like the Postgres code looks to be.

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.  But consider the NumericVar structure defined in numeric.c- is one of those stored with every row of a table, or are most of the values stored once per table and only the digits stored in the row?  From a cursory reading of the code, it's hard for me to tell.

Brian

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: probable faq: internal format of numerics
Следующее
От: Tom Lane
Дата:
Сообщение: Re: probable faq: internal format of numerics