On Wed, 3 May 2006, Heikki Linnakangas wrote:
On Tue, 2 May 2006, Tom Lane wrote:
Heikki Linnakangas <[EMAIL PROTECTED]> writes:
On Tue, 2 May 2006, Tom Lane wrote:
Backwards scan may break this whole concept; are you sure you've thought
it through?
I think so. The patch doesn't change the walk-left code. Do you have
something specific in mind?
I'm worried about synchronization, particularly what happens if the page
gets deleted from under you while you don't have it pinned.
AFAICS, shouldn't happen. The half-dead system makes sure that a page won't
get deleted while a scan might still be interested in it. It doesn't depend
on pins.
As Tom pointed out elsewhere in this thread, the above explanation is
wrong because half-dead state only applies to upper-level pages. I thought
that half-dead means that the page is dead and removed from the tree, but
not yet recycled because some transaction might still be interested in it.
Now I see that that state is actually called "deleted".
The point remains, however. A page won't get deleted while a scan
might still be interested in it, because deleted pages are not
immediately recycled (except on vacuum full), and the left and right
sibling pointers stay intact until no transaction can be interested in it.
- Heikki
---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend