Re: [HACKERS] GUC for cleanup indexes threshold. - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: [HACKERS] GUC for cleanup indexes threshold.
Date
Msg-id CAH2-Wz=K1CT=_XT6bLkCVw24X6E_7oK+FDnPK_ibzAH0ovc0dQ@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] GUC for cleanup indexes threshold.  (Stephen Frost <sfrost@snowman.net>)
List pgsql-hackers
Hi Stephen,

On Sat, Jan 6, 2018 at 4:02 PM, Stephen Frost <sfrost@snowman.net> wrote:
> Perhaps it should really be in Needs review state then..?

Probably.

As I pointed out already some time ago, this RecentGlobalXmin
interlock stuff is our particular implementation of what Lanin &
Shasha call "The Drain Technique" within "2.5 Freeing Empty Nodes".
It's not easy to understand why this is necessary in general (you have
to understand the whole paper for that), but our implementation of the
drain technique is simple. I'm afraid that I made the problem sound
scarier than it actually is.

As Lanin & Shasha put it: "freeing empty nodes by the drain technique
is transparent to the rest of the algorithm and can be added by a
separate module". nbtree doesn't actually care very much about XIDs --
testing an XID against RecentGlobalXmin was just the most convenient
way of using L&S's technique to defer recycling until it is definitely
safe. We only need to make sure that _bt_page_recyclable() cannot
become confused by XID wraparound to fix this problem -- that's it.

-- 
Peter Geoghegan


pgsql-hackers by date:

Previous
From: Chapman Flack
Date:
Subject: Re: proposal: alternative psql commands quit and exit
Next
From: Tom Lane
Date:
Subject: Re: proposal: alternative psql commands quit and exit