Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 33B83650E99 for ; Fri, 4 Jul 2008 04:34:21 -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 01131-04 for ; Fri, 4 Jul 2008 04:34:13 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gmp-eb-inf-1.sun.com (gmp-eb-inf-1.sun.com [192.18.6.21]) by postgresql.org (Postfix) with ESMTP id EF097650EA3 for ; Fri, 4 Jul 2008 04:34:15 -0300 (ADT) Received: from fe-emea-10.sun.com (gmp-eb-lb-2-fe2.eu.sun.com [192.18.6.11]) by gmp-eb-inf-1.sun.com (8.13.7+Sun/8.12.9) with ESMTP id m647YE4d022990 for ; Fri, 4 Jul 2008 07:34:14 GMT Received: from conversion-daemon.fe-emea-10.sun.com by fe-emea-10.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) id <0K3H003010QMZ100@fe-emea-10.sun.com> (original mail from Zdenek.Kotala@Sun.COM) for pgsql-patches@postgresql.org; Fri, 04 Jul 2008 08:34:14 +0100 (BST) Received: from [192.168.1.101] ([89.103.109.2]) by fe-emea-10.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPSA id <0K3H0087M110K110@fe-emea-10.sun.com>; Fri, 04 Jul 2008 08:34:13 +0100 (BST) Date: Fri, 04 Jul 2008 09:31:29 +0200 From: Zdenek Kotala Subject: Re: page macros cleanup In-reply-to: <2e78013d0807030450m4cab60d0jd99d1acce59fae56@mail.gmail.com> To: Pavan Deolasee Cc: PostgreSQL-patches Message-id: <486DD1D1.50604@sun.com> MIME-version: 1.0 Content-type: text/plain; format=flowed; charset=ISO-8859-1 Content-transfer-encoding: 7BIT References: <48529B83.9010907@sun.com> <2e78013d0807030450m4cab60d0jd99d1acce59fae56@mail.gmail.com> User-Agent: Thunderbird 2.0.0.12 (X11/20080325) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200807/41 X-Sequence-Number: 6736 Pavan Deolasee napsal(a): > On Fri, Jun 13, 2008 at 9:38 PM, Zdenek Kotala 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