Re: Tuple data - Mailing list pgsql-hackers

From Michael Richards
Subject Re: Tuple data
Date
Msg-id 04ee01c0679f$020d9740$0200a8c0@digitallis
Whole thread Raw
In response to Tuple data  ("Michael Richards" <miker@interchange.ca>)
Responses Re: Tuple data
List 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 by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: Tuple data
Next
From: Tom Lane
Date:
Subject: Re: Tuple data