Re: Tuple data

Поиск
Список
Период
Сортировка
От Michael Richards
Тема Re: Tuple data
Дата
Msg-id 04ee01c0679f$020d9740$0200a8c0@digitallis
обсуждение исходный текст
Ответ на Tuple data  ("Michael Richards" <miker@interchange.ca>)
Ответы Re: Tuple data  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
> I'm not sure, but you may see some part of the NULL bitmap.
> IIRC it started at a quite illogical place, is suspect it was at byte 31
> but
> it still reserved 4bytes for each 32 fields after byte 32
Sometimes the t_hoff value in the tuple header is 32 which seems to indicate
no NULL bitmap. This really makes me wonder what happens when you ALTER
TABLE ADD COLUMN on a table since it doesn't seem to take more than O(1)
time. Perhaps it is assumed if the attribute count is less than the actual
number of attributes then the last ones are NULL and no NULL map is
required.

> > The first tuple in my table has:
> ...
> > Bitmap: 3F00 0000 00F2
> > Attributes: 7
>
> you should have only 4 bytes of bitmap for 7 real attributes

Yes you are correct, my error. To find the bitmap length I was doing:
for (int i=0;i<header->t_hoff-30;i++)
Where if I were able to count it should have been:
for (int i=0;i<header->t_hoff-32;i++)

-Michael



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

Предыдущее
От: Hannu Krosing
Дата:
Сообщение: Re: Tuple data
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Tuple data