Re: page macros cleanup

Zdenek Kotala <[email protected]>
Newsgroups gmane.comp.db.postgresql.devel.patches
Message-ID <[email protected]>
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


-- 
Sent via pgsql-patches mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.