Re: [Patch] Make ginInsertCleanup follow vacuum's BufferAccessStrategy

From: Xuneng Zhou <xunengzhou(at)gmail(dot)com>
To: Kevin Rocker <me(at)kevinrocker(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [Patch] Make ginInsertCleanup follow vacuum's BufferAccessStrategy
Date: 2026-08-19 01:34:23
Message-ID: CABPTF7VM1vV_A4zo1NGsFmQRnWfb0oemLPyCZB3xjR7xGKX0-A@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Kevin,

On Wed, Aug 19, 2026 at 6:44 AM Kevin Rocker <me(at)kevinrocker(dot)com> wrote:
>
> The vacuum callers of ginInsertCleanup weren't able to pass the current BufferAccessStrategy, since the function didn't take a strategy argument. I modified the function to take a strategy, and passed it from the vacuum down to ReadBufferExtended. Other call-sites pass NULL as a strategy, which preserves the current behavior.

The rationale of this patch LGTM.

> I did notice 6c228755add, which uses ReadStream in ginvacuumcleanup()'s full-index scan, but I don't think that will work here: that scan knows the full block range, but the pending-list needs to read each page to get the next block.

I agree with this. That's why I did not add ginInsertCleanup as a
candidate for read stream.

> Running a quick test (script attached), we do see the strategy changing how GIN treats the buffer cache. I originally noticed this as just an inconsistency, but it may be a good improvement to how GIN vacuum interacts with shared buffers (fewer evictions on other processes).
>
> - Kevin Rocker

--
Regards,
Xuneng Zhou
HighGo Software Co., Ltd.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Richard Guo 2026-08-19 01:41:59 Re: Reduce LEFT/FULL JOIN to ANTI JOIN in more cases
Previous Message Xuneng Zhou 2026-08-19 00:16:07 Re: Fix a relcache reference leak in reorderbuffer.c