Re: Eagerly evict bulkwrite strategy ring

From: Melanie Plageman <melanieplageman(at)gmail(dot)com>
To: Kirill Reshke <reshkekirill(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: Eagerly evict bulkwrite strategy ring
Date: 2025-09-09 17:36:42
Message-ID: CAAKRu_a=+jwQDUYkoC=nWz6Ky6CGgE-ZW1XzfYaeFrQEC6+iaw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Aug 25, 2025 at 3:03 PM Melanie Plageman
<melanieplageman(at)gmail(dot)com> wrote:
>
> I just finished a draft of a patch set to do write combining for COPY
> FROM using this same heuristic as this patch for deciding to eagerly
> flush but then combining multiple buffers into a single IO. That has
> larger performance gains, so one could argue to wait to do that.

Attached v3 uses the same code structure as in the checkpointer write
combining thread [1]. I need the refactoring of FlushBuffer() now
included in this set to do the write combining in checkpointer. Upon
testing, I did notice that write combining seemed to have little
effect on COPY FROM beyond what eagerly flushing the buffers in the
ring has. The bottleneck is WAL IO and CPU. While we will need the
COPY FROM write combining to use direct IO, perhaps it is not worth
committing it just yet. For now, this thread remains limited to
eagerly flushing buffers in the BAS_BULKWRITE strategy ring.

- Melanie

[1] https://www.postgresql.org/message-id/flat/CAAKRu_bcWRvRwZUop_d9vzF9nHAiT%2B-uPzkJ%3DS3ShZ1GqeAYOw%40mail.gmail.com

Attachment Content-Type Size
v3-0002-Split-FlushBuffer-into-two-parts.patch text/x-patch 5.7 KB
v3-0003-Eagerly-flush-bulkwrite-strategy-ring.patch text/x-patch 11.1 KB
v3-0001-Refactor-goto-into-for-loop-in-GetVictimBuffer.patch text/x-patch 12.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Melanie Plageman 2025-09-09 17:55:08 Re: Checkpointer write combining
Previous Message Melanie Plageman 2025-09-09 16:24:20 Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access)