Re: Vectored I/O in bulk_write.c

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Vectored I/O in bulk_write.c
Date: 2024-03-13 23:35:27
Message-ID: CA+hUKG+xgZYDrRNuWxgjJZiuC1nohY58aOhLTuuSsgVDyvY1Kw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Mar 14, 2024 at 10:49 AM Heikki Linnakangas <hlinnaka(at)iki(dot)fi> wrote:
> I tried to say that smgr implementation might have better ways to assert
> that than calling smgrnblocks(), so it would be better to leave it to
> the implementation. But what bothered me most was that smgrwrite() had a
> different signature than mdwrite(). I'm happy with the way you have it
> in the v4 patch.

Looking for other things that can be hoisted up to smgr.c level
because they are part of the contract or would surely need to be
duplicated by any implementation: I think the check that you don't
exceed the maximum possible block number could be there too, no?
Here's a version like that.

Does anyone else want to object to doing this for 17? Probably still
needs some cleanup eg comments etc that may be lurking around the
place and another round of testing. As for the overall idea, I'll
leave it a few days and see if others have feedback. My take is that
this is what bulk_write.c was clearly intended to do, it's just that
smgr let it down by not allowing vectored extension yet. It's a
fairly mechanical simplification, generalisation, and net code
reduction to do so by merging, like this.

Attachment Content-Type Size
v5-0001-Use-smgrwritev-for-both-overwriting-and-extending.patch text/x-patch 24.8 KB
v5-0002-Use-vectored-I-O-for-bulk-writes.patch text/x-patch 4.7 KB
v5-0003-Improve-bulk_write.c-memory-management.patch text/x-patch 5.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2024-03-14 00:00:00 Re: SQL:2011 application time
Previous Message Melanie Plageman 2024-03-13 23:25:56 Re: Combine Prune and Freeze records emitted by vacuum