Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v3Cxp-00D6Qq-OX for pgsql-general@arkaria.postgresql.org; Mon, 29 Sep 2025 12:26:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1v3Cxn-000vwu-Oz for pgsql-general@arkaria.postgresql.org; Mon, 29 Sep 2025 12:26:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v3Cxn-000vwk-Ej for pgsql-general@lists.postgresql.org; Mon, 29 Sep 2025 12:26:44 +0000 Received: from mail-oo1-xc30.google.com ([2607:f8b0:4864:20::c30]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v3Cxl-000i5M-16 for pgsql-general@postgresql.org; Mon, 29 Sep 2025 12:26:43 +0000 Received: by mail-oo1-xc30.google.com with SMTP id 006d021491bc7-6426d56f376so1017257eaf.0 for ; Mon, 29 Sep 2025 05:26:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1759148799; x=1759753599; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=k0DrckbHc77/OkhmmbPsIcXkFUPrR2B+UUJTSVx3zMc=; b=cCNAkdFh0Vy0o60J29lPlIl7jUeiZHZYhI85crZOjw8IDSv6z2eTcJmY1XzysBRt6a 4W8lR9yoGnCaOskPgkWwlRae4ILJ4XfAb1ElL2ABWczmerh9eGW7ZWp69SRCapf5aJEm 00vcbZtdGpZzglaSlG6IZaPoSx9Qlsbs6AioL/mc12RLt0spnY/odFEVfZodxDp/xKeV 1VL567BdNA9Z4czF7cDq1rDn8v6ygsdW09c8IKJjjayPSHVw5KxuljiSWQKmDfOAWwsd 5xGCYAdPHrYJ4B3yQrc+oCK+qvqa4CREgRTx6BzmvQepTjAl2EIX8spIRCOzXr7Rtp6l 2B3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759148799; x=1759753599; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=k0DrckbHc77/OkhmmbPsIcXkFUPrR2B+UUJTSVx3zMc=; b=sTmna+j8xF7af4M0H9qochz6DUoRQSV9bTkRxl3ppV9Xpgxl7/PNXxMw7ppKgGJB13 ydi71RcxfrBekHZMQodww2NYXcVkOfH8sJ8ovEetkIJ1QlWLtXZEby2x6LYLCk/XfKcF cyYJSKFzdWUH3l5le5kfilG99YlP51hTmOLM3Sng1pM27sdwCzWk/c0bayx9WsDugvQ4 EaE6g5+i8sthycfduLFYv9EXvG6KHNbsR8MnFnl9iLcu8dGtVzNLE/yDG97OyXs19wS9 8y2BEAXteS++oQl9kZYBljmxC2Dkwj5ctj0wHRJobQ2gT0Ud26+wK/RHkd1YPZBYdPaJ naXg== X-Gm-Message-State: AOJu0YwGVQ91jlBUEWbgTHkmunh6D2r2QjPUpUP/dsn//JGRvl6xZh5h rTzDdrxjT9zOvrej6slvX/a8tEc8iaUuu6ULFrwgJJVz79J/i1b9rUYT1BQzcN0ZwkHbMMQim20 itueY0kuJZdWPrfSCguuQOREhcDLaLsyTjQ== X-Gm-Gg: ASbGncuSvyhhhpEF7P4OfDk34Mt1lOCqKZSAt+n0g0DanILyIVcm0YdAFmdJJiC09+0 5slu7bkEUd+yBCtGDAKl93epmEx5RJQ9FcHGxMPmo5Ni+i9jDTMFG1+WztQx73dndHL7JVUuILw b/SnamSbWs/4UNY5vcX0KhtWvYII2DxE46iiBr4+D5nfNCQ4vGdmin1SqSU0yfjvvWUDcuxJs2B KG2xY/c9b+XPnXeU4rhB/31ugJ6xWY= X-Google-Smtp-Source: AGHT+IFgf/Swq56EvrogpJ27mkTMaHy4CsGUJd2iJD/sWcu2nyFXvN8ggd9cm+Rrx/3YY4oqBMjchRu7UGWa4z4Ecw4= X-Received: by 2002:a05:6820:624:b0:623:42cb:243 with SMTP id 006d021491bc7-63a36a6b291mr1177921eaf.4.1759148799233; Mon, 29 Sep 2025 05:26:39 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dominique Devienne Date: Mon, 29 Sep 2025 14:26:27 +0200 X-Gm-Features: AS18NWBTb1nElo45hHsSNt3b4HUFVFGnNij9UARtssDRfDgbcyIrcr-1obtFgU0 Message-ID: Subject: Re: Postgre and AIO To: "Weck, Luis" Cc: "pgsql-general@postgresql.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Sep 29, 2025 at 2:07=E2=80=AFPM Weck, Luis wro= te: > 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