Skip site navigation (1) Skip section navigation (2)

Re: page macros cleanup

From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: page macros cleanup
Date: 2008-07-04 07:31:29
Message-ID: 486DD1D1.50604@sun.com (view raw or flat)
Thread:
Lists: pgsql-patches
Pavan Deolasee napsal(a):
> On Fri, Jun 13, 2008 at 9:38 PM, Zdenek Kotala <Zdenek(dot)Kotala(at)sun(dot)com> wrote:
>> I attached code cleanup which is related to in-place upgrade. I replace
>> direct access to PageHeader structure with already existing macros and I
>> removed also unnecessary retyping.
> 
> A quick review comment:

Thanks you for your review,

> 
> One thing I noticed is that the modified definition of HashMaxItemSize
> now does not account for the size of ItemId which may not be the right
> thing. Please recheck that.

Good catch. I lost in basic arithmetic. What I see now that original definition 
count sizeof(ItemIdData) twice and on other side it does not take care about 
MAXALING correctly. I think correct formula is:

#define HashMaxItemSize(page) \
         (PageGetPageSize(page) - \
           ( MAXALIGN(SizeOfPageHeaderData + sizeof(ItemIdData))+ \
             MAXALIGN(sizeof(HashPageOpaqueData)) \
           )\
          )

What do you think?

	Thanks for your comments Zdenek


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


In response to

Responses

pgsql-patches by date

Next:From: Heikki LinnakangasDate: 2008-07-04 08:26:01
Subject: Multi-column GIN
Previous:From: Tom RaneyDate: 2008-07-04 07:07:49
Subject: Re: [PATCHES] Explain XML patch v2

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group