Re: [GSoC 2026] - B-tree Index Bloat Reduction - Approach & Questions - Mailing list pgsql-hackers

From Salma El-Sayed
Subject Re: [GSoC 2026] - B-tree Index Bloat Reduction - Approach & Questions
Date
Msg-id CANBEAPFy8ig42RBqu0Y8gvi9P5n7ApyoX6dgypZ=AwUCPEPgTg@mail.gmail.com
Whole thread
In response to [GSoC 2026] - B-tree Index Bloat Reduction - Approach & Questions  (Salma El-Sayed <salmasayed182003@gmail.com>)
Responses Re: FOR PORTION OF code review
Re: [GSoC 2026] - B-tree Index Bloat Reduction - Approach & Questions
List pgsql-hackers
Hello Hackers,

Following up on the design details in [1], attached is the v3 patch series for btree leaf page merging.

This version adds WAL logging for safe crash recovery of the merge operation. It also includes WAL logging for the VACUUM cleanup operations: clearing the BTP_MERGED (M) flag from destination pages, and converting BTP_MERGED_AWAY (MA) pages into half-dead (HD) pages.

To recap, this patch merges two adjacent leaf pages that share a parent. The algorithm is non-blocking and allows both forward and backward scans to recover safely if they encounter the pages before, during, or after the merge.

The existing nbtree resource manager has only one opcode slot remaining, which is not enough for the three new merge-related WAL record types.
Rather than consume that last slot, we added a new resource manager (nbtree2), following the pattern used for heap2.


[1] https://www.postgresql.org/message-id/CANBEAPHj3iZ97i4W9EL5TicWXRyNQ1FzK_pgxaT=TJbms0AHxg@mail.gmail.com


Best,
Salma Elsayed
Attachment

pgsql-hackers by date:

Previous
From: "Chee Wooson"
Date:
Subject: [PATCH] Discard aborted updaters when expanding a multixact
Next
From: Salvatore Dipietro
Date:
Subject: Re: use a non-locking initial test in TAS_SPIN on AArch64