Re: Two different defs of MAX_TUPLES_PER_PAGE

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Two different defs of MAX_TUPLES_PER_PAGE
Дата
Msg-id 10240.1125633986@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Two different defs of MAX_TUPLES_PER_PAGE  (ITAGAKI Takahiro <itagaki.takahiro@lab.ntt.co.jp>)
Ответы Re: Two different defs of MAX_TUPLES_PER_PAGE  (ITAGAKI Takahiro <itagaki.takahiro@lab.ntt.co.jp>)
Список pgsql-hackers
ITAGAKI Takahiro <itagaki.takahiro@lab.ntt.co.jp> writes:
> I found two different definitions of MAX_TUPLES_PER_PAGE.
> Which is reasonable? Or do they have another meaning?

Hmm, I think those were both my fault at different times :-(.
Right now I am thinking that they are both not quite right,
in particular it ought to be

#define MAX_TUPLES_PER_PAGE  ((BLCKSZ - 1) / (MAXALIGN(offsetof(HeapTupleHeaderData, t_bits)) + sizeof(ItemIdData)) +
1)

That is, the heaptuple space is padded to a MAXALIGN boundary, but the
itemid that points to it isn't.  Comments?

(I believe that both modules want a ceiling definition not a floor
definition, ie round up any fraction.  The -1 / +1 trick is of course
just one way to get that.)

Also, is this something that should be in a common header file?  If so
which one?  BLCKSZ, HeapTupleHeaderData, and ItemIdData are all defined
in different places ...
        regards, tom lane


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

Предыдущее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: Additional background daemon (was: Remove xmin and cmin from frozen tuples)
Следующее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: Version number in psql banner