Re: Postgre and AIO - Mailing list pgsql-general

From Dominique Devienne
Subject Re: Postgre and AIO
Date
Msg-id CAFCRh--pj5G70NsWTrJDBgBtRVug3m432vRkQ=Du6OQ4a8LH9A@mail.gmail.com
Whole thread Raw
In response to Postgre and AIO  ("Weck, Luis" <luis.weck@pismo.io>)
List pgsql-general
On Mon, Sep 29, 2025 at 2:07 PM Weck, Luis <luis.weck@pismo.io> wrote:
> Now that AIO landed in v18,
> [...] index updating happens one at a time.
> [...] it took a long time sequentially reading the index for each value

These have nothing to do with Async-IO IMHO.

For your first case, each index is its own file, so could already be
processed in parallel, in terms of IO.

For your second case, and in general, this is about the SQL processing
engine doing more in parallel. AFAIK, because of the current (mostly?)
single-threaded-process-based architecture, parallel processing means
forking worker processes, and that's not done too often.

AIO is not a magic bullet. It just means NOT blocking waiting for IO,
so you have the opportunity to do something else during that time. But
your code must be structured to be able to do something else already.
Which is not free, and tends to make the code more complex. In
single-threaded apps, like PostgreSQL backends, that means an event
loop, and while I'm sure there's one, for the client-backend socket
IO, I'm not sure the rest of the code is loop-based.

But these are comments from someone who doesn't know the code, so feel
free to ignore :). --DD



pgsql-general by date:

Previous
From: Xuneng Zhou
Date:
Subject: Re: Postgre and AIO
Next
From: Ray O'Donnell
Date:
Subject: Re: PostgreSQL 18 not available for Noble?