Re: Use of SizeOfIptrData - is that obsolete?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Use of SizeOfIptrData - is that obsolete?
Дата
Msg-id 20550.1474383889@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Use of SizeOfIptrData - is that obsolete?  (Pavan Deolasee <pavan.deolasee@gmail.com>)
Ответы Re: Use of SizeOfIptrData - is that obsolete?  (Pavan Deolasee <pavan.deolasee@gmail.com>)
Список pgsql-hackers
Pavan Deolasee <pavan.deolasee@gmail.com> writes:
> I happened to notice this comment in src/include/storage/itemptr.h

>  * Note: because there is an item pointer in each tuple header and index
>  * tuple header on disk, it's very important not to waste space with
>  * structure padding bytes.  The struct is designed to be six bytes long
>  * (it contains three int16 fields) but a few compilers will pad it to
>  * eight bytes unless coerced.  We apply appropriate persuasion where
>  * possible, and to cope with unpersuadable compilers, we try to use
>  * "SizeOfIptrData" rather than "sizeof(ItemPointerData)" when computing
>  * on-disk sizes.
>  */

> Is that now obsolete?

Realistically, because struct HeapTupleHeaderData contains a field of
type ItemPointerData, it's probably silly to imagine that we can save
anything if the compiler can't be persuaded to believe that
sizeof(ItemPointerData) is 6.  It may well be that the structure pragmas
work on everything that wouldn't natively believe that anyway.
        regards, tom lane



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Parallel sec scan in plpgsql
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: more parallel query documentation