Hackers,
I'm very sorry to report that I couldn't finish the btree free page
handling patch. I leave tomorrow and will be back on March next year,
so probably it's better for someone else to take what I have done to
test, review or discard entirely. If nothing happens, I'll take it
again when I'm back and hopefully have it ready for 7.4. However this
is a dangerous patch (deadlocks, maybe index corruption, even WAL log
corruption in some cases) and is probably better to integrate it early
so it gets lots of testing --- a working version, that is.
What does this patch do: it marks empty pages as BTP_DEAD during
btbulkdelete, and those pages are later marked BTP_FREE and added to the
freelist. How the freelist is handled is explained in the initial
comment in nbtfreelist.c. This works reasonably well, though I didn't
try INSERTing concurrently with VACUUM (this is important).
What is missing: support from _bt_endpoint() is the most obvious thing.
In practice this means that one can't run VACUUM a second time in
general :-(. Probably _bt_search() is broken too.
I probably will be reading email from time to time, so if anything comes
up or there's something for me to clarify please reply to this or take
it to -hackers with CC to me.
--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Vivir y dejar de vivir son soluciones imaginarias.
La existencia está en otra parte" (Andre Breton)