Optimization of the alignment padding

Поиск
Список
Период
Сортировка
От ITAGAKI Takahiro
Тема Optimization of the alignment padding
Дата
Msg-id 20051109153003.549B.ITAGAKI.TAKAHIRO@lab.ntt.co.jp
обсуждение исходный текст
Ответы Re: Optimization of the alignment padding  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-hackers
Hi Hackers,

After the subtransaction had been added,
the size of HeapTupleHeader became 27 bytes.
This consumes extra bytes per tuple for the alignment padding,
especially on systems where MAXIMUM_ALIGNOF is 8.

This patch optimizes the location of the first field,
and reduces the padding. I expect most rows are saved
about 4 bytes, if the table definition is appropriate.

Following is a bit artificial test:
  # CREATE TABLE test (c "char", i int4);
  # INSERT INTO test VALUES('A', 1);
  # SELECT * FROM pgstattuple('test');

the size of a tuple (8.1.0) is 40 bytes:
    [27] HeapTupleHeader
    [ 5] (padding)
    [ 1] c "char"
    [ 3] (padding)
    [ 4] i int4

the size of tuple (patched) is 32 bytes
    [27] HeapTupleHeader
    [ 1] c "char"
    [ 4] i int4

Is this effective? Or are there some problems?
I'll appreciate any comments.
Thanks,
---
ITAGAKI Takahiro
NTT Cyber Space Laboratories

Вложения

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

Предыдущее
От: daveg
Дата:
Сообщение: Re: Exclusive lock for database rename
Следующее
От: sandeep satpal
Дата:
Сообщение: How postgres find OID of function from opclassoid