Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 5894F650E8F for ; Fri, 4 Jul 2008 08:18:45 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 15396-10 for ; Fri, 4 Jul 2008 08:18:38 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail01.enterprisedb.com (webmail.enterprisedb.com [63.246.7.168]) by postgresql.org (Postfix) with ESMTP id 4F90B650E7F for ; Fri, 4 Jul 2008 08:18:42 -0300 (ADT) thread-index: Acjdx9Qpzc59/MXQRRe7EFZiP0pdBw== Content-Class: urn:content-classes:message Importance: normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4133 Received: from [80.222.70.18] ([80.222.70.18]) by mail01.enterprisedb.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Fri, 4 Jul 2008 07:19:30 -0400 Message-ID: <486E070D.8010101@enterprisedb.com> Date: Fri, 04 Jul 2008 14:18:37 +0300 From: "Heikki Linnakangas" Organization: EnterpriseDB User-Agent: Mozilla-Thunderbird 2.0.0.14 (X11/20080509) MIME-Version: 1.0 To: "Zdenek Kotala" Cc: "Pavan Deolasee" , "PostgreSQL-patches" Subject: Re: page macros cleanup References: <48529B83.9010907@sun.com> <2e78013d0807030450m4cab60d0jd99d1acce59fae56@mail.gmail.com> <486DD1D1.50604@sun.com> <2e78013d0807040150w393ad72codaf06a6ac12a83ce@mail.gmail.com> <486DF644.4070604@enterprisedb.com> <486E008F.3080304@sun.com> In-Reply-To: <486E008F.3080304@sun.com> Content-Type: text/plain; format=flowed; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 04 Jul 2008 11:19:30.0156 (UTC) FILETIME=[D3CA9AC0:01C8DDC7] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200807/65 X-Sequence-Number: 6759 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. To put it another way, it's possible that there's an unaligned amount of free space on a page, as returned by PageGetExactFreeSpace. But since item size is always MAXALIGNed, it's impossible to use it all. 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. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com