Re: Attribute Alignment

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Michael Richards" <miker(at)interchange(dot)ca>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Attribute Alignment
Date: 2000-12-17 22:45:46
Message-ID: 26957.977093146@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Michael Richards" <miker(at)interchange(dot)ca> writes:
> Is this alignment relative to the beginning of the page or tuple, or even
> the tuple data area (after the tuple header)?

Well, it's absolute: on machines that care about such things, you *will*
coredump if you try to fetch an int at a non-4-byte-aligned address.

Our implementation forces tuple data area (also tuple header) to start
at a MAXALIGN'd offset in the page, and we ensure that page buffers
start at MAXALIGN'd addresses. So the attribute access routines only
have to worry about suitable alignment of the field's offset within the
tuple data. You'd get the same answer however you measured it, but
I think the code usually does the alignment computation on the offset
within the tuple data.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-12-17 22:53:37 Re: Who is a maintainer of GiST code ?
Previous Message Hannu Krosing 2000-12-17 22:27:05 Re: Tuple data