Re: Question regarding the database page layout.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Question regarding the database page layout.
Дата
Msg-id 25437.1220380531@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Question regarding the database page layout.  (Gregory Stark <stark@enterprisedb.com>)
Ответы Re: Question regarding the database page layout.
Список pgsql-hackers
Gregory Stark <stark@enterprisedb.com> writes:
> The other 4 bytes you could save is by packing the whole tuples themselves
> more closely on the page. That happens when the item pointer is added and
> pointed to the tuple. To do that heap_form_tuple would have to return data
> back to the caller about the alignment needed to whomever is going to copy it
> into the page. AFAICS that could be done in the HeapTuple structure itself
> rather than in the tuple though which doesn't seem so bad. Tom may be seeing
> something I'm not though.

You'd need to keep the info available for subsequent re-compactions of
the page, so I think an infomask bit is really the only solution that
would work.

But on reflection, that's really a separable issue from whether we
minimize t_hoff padding.  And as Ryan's patch shows, it's not that hard
to do the latter.  We should probably grab the low-hanging fruit here.

> Incidentally, can't you set the alignment during the compute_data_size() call
> instead of doing an extra pass through the attributes?

+1.  This code is executed often enough that every little bit helps.

BTW, there are at least two copies of that code to be changed.  I'd
suggest grepping for assignments to t_hoff to be sure there aren't more.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Mysterious Bus Error with get_fn_expr_argtype()
Следующее
От: "David E. Wheeler"
Дата:
Сообщение: Re: Mysterious Bus Error with get_fn_expr_argtype()