Re: [WIP] Reduce alignment requirements on 64-bit systems.

Поиск
Список
Период
Сортировка
От ITAGAKI Takahiro
Тема Re: [WIP] Reduce alignment requirements on 64-bit systems.
Дата
Msg-id 20081009204749.188B.52131E4D@oss.ntt.co.jp
обсуждение исходный текст
Ответ на [WIP] Reduce alignment requirements on 64-bit systems.  ("Ryan Bradetich" <rbradetich@gmail.com>)
Ответы Re: [WIP] Reduce alignment requirements on 64-bit systems.  ("Ryan Bradetich" <rbradetich@gmail.com>)
Список pgsql-hackers
"Ryan Bradetich" <rbradetich@gmail.com> wrote:

> Here is a proof-of-concept patch for reducing the alignment
> requirement for heap tuples on 64-bit systems.
> 
> pg_depend         312 kB                  296 kB
> pg_description    160 kB                  152 kB

5 percent of gain seems reasonable for me.
Is it possible to apply your improvement for indexes?
I think there are more benefits for small index entries
that size are often 12 or 20 bytes.


> This would completely eliminate the impact for this
> patch on 32-bit systems, which would not gain any benefit from this patch.

No! There are *also* benefits even on 32-bit systems, because some
of them have 8-byte alignment. (for example, 32-bit Windows)


BTW, there might be a small mistabke on the following lines in patch.
They do the same things ;-)

***************
*** 1019,1025 **** toast_flatten_tuple_attribute(Datum value,         new_len += BITMAPLEN(numAttrs);     if
(olddata->t_infomask& HEAP_HASOID)         new_len += sizeof(Oid);
 
!     new_len = MAXALIGN(new_len);     Assert(new_len == olddata->t_hoff);     new_data_len =
heap_compute_data_size(tupleDesc,                                          toast_values, toast_isnull);
 
--- 1025,1034 ----         new_len += BITMAPLEN(numAttrs);     if (olddata->t_infomask & HEAP_HASOID)         new_len
+=sizeof(Oid);
 
!     if (olddata->t_infomask & HEAP_INTALIGN)
!         new_len = MAXALIGN(new_len);
!     else
!         new_len = MAXALIGN(new_len);     Assert(new_len == olddata->t_hoff);     new_data_len =
heap_compute_data_size(tupleDesc,                                          toast_values, toast_isnull);
 


Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center




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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: CREATE DATABASE vs delayed table unlink
Следующее
От: Tom Lane
Дата:
Сообщение: Re: CREATE DATABASE vs delayed table unlink