Re: Attribute Alignment - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Attribute Alignment
Date
Msg-id 26957.977093146@sss.pgh.pa.us
Whole thread Raw
In response to Re: Attribute Alignment  ("Michael Richards" <miker@interchange.ca>)
List pgsql-hackers
"Michael Richards" <miker@interchange.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


pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: Tuple data
Next
From: Tom Lane
Date:
Subject: Re: Who is a maintainer of GiST code ?