Re: Tuple data

From: "Michael Richards" <miker(at)interchange(dot)ca>
To: "Hannu Krosing" <hannu(at)tm(dot)ee>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Tuple data
Date: 2000-12-16 20:30:16
Message-ID: 04ee01c0679f$020d9740$0200a8c0@digitallis
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Oleg Bartunov 2000-12-16 20:34:35 Re: [HACKERS] 7.1 features list
Previous Message Tom Lane 2000-12-16 20:29:51 Re: Tuple data