Re: page macros cleanup

From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
Cc: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: page macros cleanup
Date: 2008-07-04 11:47:00
Message-ID: 486E0DB4.9030400@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Zdenek Kotala 2008-07-04 12:11:59 Re: page macros cleanup (ver 04)
Previous Message Heikki Linnakangas 2008-07-04 11:18:37 Re: page macros cleanup