Re: page macros cleanup - Mailing list pgsql-patches

From Zdenek Kotala
Subject Re: page macros cleanup
Date
Msg-id 486E0DB4.9030400@sun.com
Whole thread Raw
In response to Re: page macros cleanup  ("Heikki Linnakangas" <heikki@enterprisedb.com>)
List pgsql-patches
Heikki Linnakangas napsal(a):
> Zdenek Kotala wrote:
>> By my opinion first place where tuple should be placed is:
>>
>> MAXALIGN(SizeOfPageHeaderData + sizeof(ItemIdData))
>
> Yeah, but we don't enforce that directly. We enforce it by MAXALIGNing
> size in PageAddItem, and with the rule that special-size is MAXALIGNed.

Yeah, it is implication from other rules. But how Pavan mentioned and I agree
with him. We should have *MaxItemSize value maxaligned, because tuple is
maxaligned anyway and *MaxItemSize defines real limit.

>
> Come to think of it, why do we require MAXALIGN alignment of tuples? I
> must be missing something, but AFAICS the widest fields in
> HeapTupleHeaderData are 4-bytes wide, so it should be possible to get
> away with 4-byte alignment.
>

I think that you have problem to make correct decision about padding between
header and first data item on platform where MAXALIGN is 8. Padding will depends
   on align of offset - if it is max aligned or not. It will have effect for
example on SPARC but it adds extra complexity to code. ... Maybe only set hoff
correctly when new tuple is created ...

Another improvement should be reorder column to got best space allocation during
create table (of course it affect select * from).


        Zdenek

--
Zdenek Kotala              Sun Microsystems
Prague, Czech Republic     http://sun.com/postgresql


pgsql-patches by date:

Previous
From: "Heikki Linnakangas"
Date:
Subject: Re: page macros cleanup
Next
From: Zdenek Kotala
Date:
Subject: Re: page macros cleanup (ver 04)