Re: Understanding VARHDRSZ

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Understanding VARHDRSZ
Дата
Msg-id 29979.1153977862@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Understanding VARHDRSZ  ("Redefined Horizons" <redefined.horizons@gmail.com>)
Список pgsql-general
"Redefined Horizons" <redefined.horizons@gmail.com> writes:
> Page 524 of the PostgreSQL 8.1 Manual, PDF Edition, has a code snippit
> that makes use of the VARHDRSZ macro. I'm trying to understand the
> purpose of this macro.

It's just a symbol for the size of the length word at the start of the
stored value.

> If this is the case, why even have the VARHDRSZ macro?

Someday, we might want to change the size of the length word (eg,
move to int8, when no one uses mere 32-bit machines anymore).  That
will be a painful undertaking in any case, but everyplace that codes
the overhead space as "VARHDRSZ" rather than "4" will be one less
place to fix.

            regards, tom lane

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

Предыдущее
От: Q
Дата:
Сообщение: Re: Problem with table slowing down - Help with EXPLAIN reqd
Следующее
От: Tomasz Ostrowski
Дата:
Сообщение: Re: Generating unique session ids