Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Patches > Re: page macros...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 12 of 26 Topic 3804 of 4088
Post > Topic >>

Re: page macros cleanup

by Zdenek.Kotala@[EMAIL PROTECTED] (Zdenek Kotala) Jul 4, 2008 at 12:50 PM

Heikki Lin****angas napsal(a):
> Pavan Deolasee wrote:
>> On Fri, Jul 4, 2008 at 1:01 PM, Zdenek Kotala <Zdenek.Kotala@[EMAIL PROTECTED]
> 
>> wrote:
>>>
>>> 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?
>>
>> Yes. I think that's the correct way.
> 
> Doesn't look right to me. There's no padding after the first line 
> pointer, hence the first MAXALIGN shouldn't be there.

Are you sure? I expecting that tupleheader must be aligned to MAXALIGN. If
it is 
not required than you are right.

Look on PageAddItem:

00226     alignedSize = MAXALIGN(size);
00227
00228     upper = (int) phdr->pd_upper - (int) alignedSize;

By my opinion first place where tuple should be placed is:

MAXALIGN(SizeOfPageHeaderData + sizeof(ItemIdData))


> BTW, looking at ha****nsert.c where it's used, we're actually passing a 
> pointer to the meta page to HashMaxItemSize(). So the PageGetPageSize() 
> call on that is quite bogus, since it's not the meta page that the tuple

> is going to be inserted to. It's academical, because all pages are the 
> same size anyway, but doesn't look right. I think I'd go with BLKCSZ 
> instead.
> 

Yeah, BLKCSZ looks good. Anyway, I plan to reorganize all *MaxItemSize
staff to 
be compatible with in-place upgrade.

		thanks Zdenek


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


-- 
Sent via pgsql-patches mailing list (pgsql-patches@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches
 




 26 Posts in Topic:
page macros cleanup
Zdenek.Kotala@[EMAIL PROT  2008-06-13 18:08:35 
Re: page macros cleanup
pavan.deolasee@[EMAIL PRO  2008-07-03 17:20:52 
Re: page macros cleanup
heikki@[EMAIL PROTECTED]   2008-07-03 17:04:51 
Re: page macros cleanup
Zdenek.Kotala@[EMAIL PROT  2008-07-04 10:38:04 
Re: page macros cleanup
pavan.deolasee@[EMAIL PRO  2008-07-04 14:33:41 
Re: page macros cleanup (ver 03)
Zdenek.Kotala@[EMAIL PROT  2008-07-04 11:57:47 
Re: page macros cleanup
Zdenek.Kotala@[EMAIL PROT  2008-07-04 09:31:29 
Re: page macros cleanup
pavan.deolasee@[EMAIL PRO  2008-07-04 14:20:12 
Re: page macros cleanup
heikki@[EMAIL PROTECTED]   2008-07-04 13:07:00 
Re: page macros cleanup
pavan.deolasee@[EMAIL PRO  2008-07-04 16:20:03 
Re: page macros cleanup
heikki@[EMAIL PROTECTED]   2008-07-04 13:55:44 
Re: page macros cleanup
Zdenek.Kotala@[EMAIL PROT  2008-07-04 12:50:55 
Re: page macros cleanup
heikki@[EMAIL PROTECTED]   2008-07-04 14:18:37 
Re: page macros cleanup
pavan.deolasee@[EMAIL PRO  2008-07-04 16:34:15 
Re: page macros cleanup
pavan.deolasee@[EMAIL PRO  2008-07-04 16:35:36 
Re: page macros cleanup
Zdenek.Kotala@[EMAIL PROT  2008-07-04 13:04:15 
Re: page macros cleanup
Zdenek.Kotala@[EMAIL PROT  2008-07-04 13:13:03 
Re: page macros cleanup
Zdenek.Kotala@[EMAIL PROT  2008-07-04 13:47:00 
Re: page macros cleanup (ver 04)
Zdenek.Kotala@[EMAIL PROT  2008-07-04 14:11:59 
Re: page macros cleanup (ver 04)
heikki@[EMAIL PROTECTED]   2008-07-09 14:54:08 
Re: page macros cleanup (ver 04)
tgl@[EMAIL PROTECTED] (T  2008-07-13 15:02:19 
Re: page macros cleanup (ver 04)
Zdenek.Kotala@[EMAIL PROT  2008-07-08 21:28:27 
Re: page macros cleanup (ver 04)
Zdenek.Kotala@[EMAIL PROT  2008-07-09 15:43:59 
Re: page macros cleanup (ver 04)
tgl@[EMAIL PROTECTED] (T  2008-07-13 14:05:44 
Re: page macros cleanup (ver 04)
Zdenek.Kotala@[EMAIL PROT  2008-07-21 21:19:25 
Re: page macros cleanup (ver 04)
tgl@[EMAIL PROTECTED] (T  2008-07-21 16:16:13 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Oct 12 9:28:06 CDT 2008.