pg.ddx.io  pgsql-patches@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Zdenek Kotala <Zdenek.Kotala@Sun.COM>
To: Pavan Deolasee <pavan.deolasee@gmail.com>
Cc: PostgreSQL-patches <pgsql-patches@postgresql.org>
Subject: Re: page macros cleanup
Date: Fri, 04 Jul 2008 09:31:29 +0200
Message-ID: <486DD1D1.50604@sun.com> (raw)
In-Reply-To: <2e78013d0807030450m4cab60d0jd99d1acce59fae56@mail.gmail.com>
References: <48529B83.9010907@sun.com>
	<2e78013d0807030450m4cab60d0jd99d1acce59fae56@mail.gmail.com>

Pavan Deolasee napsal(a):
> On Fri, Jun 13, 2008 at 9:38 PM, Zdenek Kotala <Zdenek.Kotala@sun.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




view thread (17+ messages)  latest in thread

Message-ID: <486DD1D1.50604@sun.com>
Permalink:  ../486DD1D1.50604@sun.com/
Also on:    postgresql.org/message-id/486DD1D1.50604@sun.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-patches@postgresql.org
  Cc: Zdenek.Kotala@Sun.COM, pavan.deolasee@gmail.com
  Subject: Re: page macros cleanup
  In-Reply-To: <486DD1D1.50604@sun.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox