Re: COPY performance on Windows

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: "Ryohei Takahashi (Fujitsu)" <r(dot)takahashi_2(at)fujitsu(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: COPY performance on Windows
Date: 2024-12-12 04:48:35
Message-ID: CA+hUKGJtJF1BLdwHAExi2oEgtP333xy4a3kPQ2ZeyO+BMS-kXw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Dec 12, 2024 at 1:18 AM Ryohei Takahashi (Fujitsu)
<r(dot)takahashi_2(at)fujitsu(dot)com> wrote:
> The performance of PG16.6 and PG17.0 are worse than PG16.4.
> So, I think the commits between August and September affects the performance.
> I will analyze these commits.

If it reproduces reliably, maybe git bisect? Do you have a profiler?
Can you show the system call trace for good and bad behaviour? But I
wonder if there might just be some weird code placement variation
causing arbitrary performance changes, because nothing is jumping out
of that version range when I look at it... How do other versions, .0,
.1, .2, .3 perform? What about 15.x?

Just by the way, in case you are interested in the broader topic of
bulk file extension, here are some ideas that might be worth trying
out on a serious Windows server (maybe later once the unexpected
regression is understood):

1. Those code paths finish up in pg_pwritev(), but it has a loop over
8kb writes on Windows. Does it help if we just make "zbuffer" bigger?
How big?
2. While pondering the goals of posix_fallocate(), I had a
realisation about how we might implement FileFallocate() on Windows.
Does this idea work? Well?

Experiment-grade patches attached.

Attachment Content-Type Size
0001-Use-bigger-writes-in-pg_pwrite_zeros-on-Windows.patch text/x-patch 1.7 KB
0001-Implement-FileFallocate-for-Windows.patch text/x-patch 1.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2024-12-12 04:52:03 Re: per backend I/O statistics
Previous Message jian he 2024-12-12 04:38:06 Re: Pass ParseState as down to utility functions.