Re: WIP: pre-upgrade page reservation - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: WIP: pre-upgrade page reservation
Date
Msg-id 4948D567.4060908@enterprisedb.com
Whole thread Raw
In response to Re: WIP: pre-upgrade page reservation  (Zdenek Kotala <Zdenek.Kotala@Sun.COM>)
Responses Re: WIP: pre-upgrade page reservation
List pgsql-hackers
Zdenek Kotala wrote:
> Heikki Linnakangas napsal(a):
>> Zdenek Kotala wrote:
>>> BTree space reservation is more complicated. 
>>
>> Do you need to pre-reserve the space for b-tree? I think you can just 
>> split it at upgrade, in the new version. The problem with doing that 
>> for heaps is that to move a heap tuple you need to update the index 
>> pointers, but for indexes there's no such restriction.
> 
> The problem is that I need to know parent and modify parent as well. But 
> you don't know what is your parent node. You need to know root and go 
> from root.
> It is why I think that it is not doable online.

Oh, you're planning to walk the B-tree in index order, not physical 
order, so that you always have the stack for inserting the parents? You 
don't necessarily need the stack, if you're not worried about 
performance. _bt_insert_parent will scan the next level up to find the 
parent in that case. That's slow, but so is walking the B-tree, and I'd 
expect it to be rare that you need to split b-tree pages at upgrade anyway.

(I still think you're distracted, BTW. There's zero evidence that we'll 
need any of this for the 8.4->8.5 upgrade. And if we do, we don't know 
for sure that this will solve the problem, whatever the problem is.)

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Zdenek Kotala
Date:
Subject: Re: WIP: pre-upgrade page reservation
Next
From: Simon Riggs
Date:
Subject: Re: Sync Rep: First Thoughts on Code