Re: Two different defs of MAX_TUPLES_PER_PAGE
От | ITAGAKI Takahiro |
---|---|
Тема | Re: Two different defs of MAX_TUPLES_PER_PAGE |
Дата | |
Msg-id | 20050902141552.4763.ITAGAKI.TAKAHIRO@lab.ntt.co.jp обсуждение исходный текст |
Ответ на | Re: Two different defs of MAX_TUPLES_PER_PAGE (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: Two different defs of MAX_TUPLES_PER_PAGE
|
Список | pgsql-hackers |
Tom Lane <tgl@sss.pgh.pa.us> wrote: > #define MAX_TUPLES_PER_PAGE ((BLCKSZ - 1) / (MAXALIGN(offsetof(HeapTupleHeaderData, t_bits)) + sizeof(ItemIdData)) + 1) > (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.) Don't you think about PageHeaderData? Also I guess a floor definition is ok because 'number of tuples' is an integer. How about the following? ((BLCKSZ - offsetof(PageHeaderData, pd_linp)) / (MAXALIGN(offsetof(HeapTupleHeaderData, t_bits)) + sizeof(ItemIdData))) > 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 ... Considering include-hierarchy, I think bufpage.h is a good place. --- ITAGAKI Takahiro NTT Cyber Space Laboratories
В списке pgsql-hackers по дате отправления: