Re: [WiP] B-tree page merge during vacuum to reduce index bloat - Mailing list pgsql-hackers

From Madhav Madhusoodanan
Subject Re: [WiP] B-tree page merge during vacuum to reduce index bloat
Date
Msg-id CAKw2Pb2wV=L4yeAqj27wJ1wptHt1mnBaQ5t4YuLLe+M5aU6ESg@mail.gmail.com
Whole thread
In response to Re: [WiP] B-tree page merge during vacuum to reduce index bloat  (Kirk Wolak <wolakk@gmail.com>)
Responses Re: [WiP] B-tree page merge during vacuum to reduce index bloat
Re: [WiP] B-tree page merge during vacuum to reduce index bloat
List pgsql-hackers
On Tue, Aug 26, 2025 at 2:11 PM Kirk Wolak <wolakk@gmail.com> wrote:
> I do have a question, one of the IDEAS we discussed was to ADD a new page that combined the 2 pages.

Would the flow then be as follows? Please correct me if I'm wrong:
Start: Parent page P, with adjacent child pages A -> B -> C -> D.
Pages B and C are sparse enough and are about to be merged.
1: Acquire lock on pages B and C
2: Create a new page N, which copies the tuples in pages B and C
3: Acquire lock on parent page P, update the separator keys in P,
release lock on P
4: Update pointers such that pages link like so: A -> N -> D
5: Release lock on pages B and C

Regards,

Madhav



pgsql-hackers by date:

Previous
From: Sami Imseih
Date:
Subject: Re: Fix bug in multixact Oldest*MXactId initialization and access
Next
From: Tom Lane
Date:
Subject: Re: Non-text mode for pg_dumpall