Number of attributes in HeapTupleHeader

Поиск
Список
Период
Сортировка
От Manfred Koizar
Тема Number of attributes in HeapTupleHeader
Дата
Msg-id ld7bduco24snoum0l2p5pvjooc8443svk8@4ax.com
обсуждение исходный текст
Ответы Re: Number of attributes in HeapTupleHeader  (Neil Conway <nconway@klamath.dyndns.org>)
Re: Number of attributes in HeapTupleHeader  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Number of attributes in HeapTupleHeader  ("Hiroshi Inoue" <Inoue@tpf.co.jp>)
Список pgsql-hackers
Currently there's an int16 t_natts in HeapTupleHeaderData.  This
number is stored on disk for every single tuple.  Assuming that the
number of attributes is constant for all tuples of one relation we
have a lot of redundancy here.

Almost everywhere in the sources, where HeapTupleHeader->t_natts is
used, there is a HeapTuple and/or TupleDesc around.  In struct
tupleDesc there is int natts /* Number of attributes in the tuple */.
If we move t_natts from  struct HeapTupleHeaderData to struct
HeapTupleData, we'd have this number whenever we need it and didn't
have to write it to disk millions of times.

Two years ago there have been thoughts about ADD COLUMN and whether it
should touch all tuples or just change the metadata.  Could someone
tell me, what eventually came out of this discussion and where I find
the relevant pieces of source code, please.  What about DROP COLUMN?

If there is interest in reducing on-disk tuple header size and I have
not missed any strong arguments against dropping t_natts, I'll
investigate further.  Comments?

On Fri, 3 May 2002 01:40:42 +0000 (UTC), tgl@sss.pgh.pa.us (Tom Lane)
wrote:
> Now if
>we could get rid of 8 bytes in the header, I'd get excited ;-)

If this is doable, we arrive at 6 bytes.  And what works for t_natts,
should also work for t_hoff; that's another byte.  Are we getting
nearer?

ServusManfred


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

Предыдущее
От: mlw
Дата:
Сообщение: Re: Musings
Следующее
От: Neil Conway
Дата:
Сообщение: Re: Number of attributes in HeapTupleHeader