RE: btree split logic is fragile in the presence of large index items - Mailing list pgsql-hackers

From Hiroshi Inoue
Subject RE: btree split logic is fragile in the presence of large index items
Date
Msg-id 000801bff135$1a0d4060$2801007e@tpf.co.jp
Whole thread Raw
In response to Re: btree split logic is fragile in the presence of large index items  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> -----Original Message-----
> From: pgsql-hackers-owner@hub.org [mailto:pgsql-hackers-owner@hub.org]On
> Behalf Of Tom Lane
>
> I've been chewing some more on the duplicate-key btree issue, and
> digging through CVS logs and Postgres v4.2 to try to understand the
> history of the code (and boy, this code does have a lot of history
> doesn't it?)
>
> One thing I'm still not too clear on is how we handle backwards
> indexscans.  After looking at Lehman and Yao's paper it seems like
> only forward scans are guaranteed to work when other processes are
> busy splitting pages.  Anybody know how that's handled?
>

There's the following comment for backwards scan in _bt_step()
in nbtsearch.c
                                       /*                                        * If the adjacent page just split,
thenwe may have                                        * the wrong block.  Handle this
case.
Because pages                                        * only split right, we don't have
to wo
rry about this                                        * failing to terminate.
*/

Seems backwards index scans sometimes move right(scan forward).

Regards.

Hiroshi Inoue



pgsql-hackers by date:

Previous
From: The Hermit Hacker
Date:
Subject: Re: [PORTS] Shared library search paths
Next
From: Chris Bitmead
Date:
Subject: Re: MySQL comparison