Re: Allow io_combine_limit up to 1MB

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Tomas Vondra <tomas(at)vondra(dot)me>
Subject: Re: Allow io_combine_limit up to 1MB
Date: 2025-02-12 02:24:21
Message-ID: CA+hUKGJ_c2XtmXSz4LFTN=1jUK=KFQdJDy0aGdJ5houaFMhHNg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Feb 12, 2025 at 3:22 PM Andres Freund <andres(at)anarazel(dot)de> wrote:
> On 2025-02-12 13:59:21 +1300, Thomas Munro wrote:
> > How about just maintaining it in a new variable
> > effective_io_combine_limit, whenever either of them is assigned?
>
> Yea, that's probably the least bad way.
>
> I wonder if we should just name that variable io_combine_limit and have the
> GUC be _raw or _guc or such? There's gonna be a fair number of references to
> the variable in code...

Alternatively, we could compute that as stream->io_combine_limit and
use that. That has the advantage that it's fixed for the life of the
stream, even if you change it (eg between fetches from a CURSOR that
has streams). Pretty sure it won't break anything today, but it might
just run out of queue space limiting concurrency arbitrarily if you
increase it, which is a bit weird now that I focus on that. Capturing
the value we'll use up front seems better on that front. On the other
hand, other future code might also have to remember to compute that
too (write streams, ...), a tiny bit of duplication. Something like
the attached. Or ... I guess we could do both things?

Attachment Content-Type Size
v2-0001-Introduce-max_io_combine_limit.patch text/x-patch 10.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Sabino Mullane 2025-02-12 02:54:33 Re: [PATCH] Optionally record Plan IDs to track plan changes for a query
Previous Message Andres Freund 2025-02-12 02:22:54 Re: Allow io_combine_limit up to 1MB