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

From Kirk Wolak
Subject Re: [GSoC 2026] - B-tree Index Bloat Reduction - Approach & Questions
Date
Msg-id CACLU5mQp-bzxT6BMR3Dk8RM16bg-KGRAbm7nuHgiqA+rbqxF6Q@mail.gmail.com
Whole thread
List pgsql-hackers
On Thu, Jun 11, 2026 at 3:19 PM Robert Haas <robertmhaas@gmail.com> wrote:
On Fri, May 8, 2026 at 10:40 AM Salma El-Sayed
...
> How should the merge process be triggered?

This seems really tricky. I think if the user has to manually run a
"try to merge pages" command or function, this functionality won't get
used very much. Ideally it would happen either automatically during
foreground operation, or as part of VACUUM. But that seems complicated
to make work, because there's a risk of merging pages too
aggressively, which could not only waste work but result in them being
split again soon afterward.
 
Totally agree, Robert!

Our goal on this project is:
1) Provably Solve the problem with ONLY a function (on demand)
2) Teaching AutoVacuum to reset BTP_MERGED* back to normal, after XID as you suggested.
3) Experiment with various levels of how much work each function call performs (we are being very conservative)

But the final progress might be:
A) A core function for people to run/use (fine tune control over how aggressive)
B) Integrated into AutoVacuum (when it sees/makes mostly empty pages, it spits out a request to merge them, out of process)
C) Integrated into AutoVacuum (it actually applies the merge).  This is currently a step way too far away.

But that is likely going to be over full versions of  PG (probably years, not months).

Kirk

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Use \if/\endif to remove non-libxml2 expected output in regression tests
Next
From: Tom Lane
Date:
Subject: Re: Use \if/\endif to remove non-libxml2 expected output in regression tests