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 1v3CxA-00D6LI-BE for pgsql-general@arkaria.postgresql.org; Mon, 29 Sep 2025 12:26:04 +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 1v3Cx8-000r03-EH for pgsql-general@arkaria.postgresql.org; Mon, 29 Sep 2025 12:26:03 +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 1v3Cx8-000qzv-09 for pgsql-general@lists.postgresql.org; Mon, 29 Sep 2025 12:26:02 +0000 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v3Cx6-000i3m-19 for pgsql-general@postgresql.org; Mon, 29 Sep 2025 12:26:02 +0000 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-b346142c74aso876581666b.2 for ; Mon, 29 Sep 2025 05:25:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1759148759; x=1759753559; 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=I4I25e1FVdIlVS9+5y8E3HvxEtB/YyDgXxnd82Dp5cg=; b=OCv6POzgiTkMBI3KDLn0+IXf1av7Z+rstj5JtuC8/xEH8AFFujS9gCIwiMywIBPB2e hx5WMmiJafDaokrqsBRfvpTViKj2EYeb2x9zFBLySbHOTBVt0Xvewg2XQ4+k3uvho4HJ EctrLhYMS25YgVsHuP5ilGyShxPwL03FGyy3c9W92glBNAGy1ml630ZqH1ZKEO3sVt9f 1XgXUahnKi+F1dfZfj6rwJQ1fscpVAFdlXbvlHKHoY7BOh9Sp3sv+l1OcJc8PAYG8jBj 161ZntdcZwM5VZ45eCT77G/rxS83ui2ikzshwsuAM6LH+2Z3lVPbjSMNOgQw7miBXK6l d6aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759148759; x=1759753559; 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=I4I25e1FVdIlVS9+5y8E3HvxEtB/YyDgXxnd82Dp5cg=; b=NRW20eMHJkSBiNNJ+1KzRV3WD2LO1C2v1t0MU7Qrhchdn1dG94otg2RSKeKVR9tBBb 3NJZkNaahU5ivB79DdBfu5N9fBVBEneP5wy60wA3Dc/70WQikr0i8JqmSJiEZt+z2N5j W8CrH2lSdNRMgmhEAmGTfQq62Upbu7NJWrk7yO6OnEOzAaEWd0a5eNsBaBVuRO/iozsA nVaMJNzxsD0kn174OfW82GxIkKyzvPB0dnTsdlxtGTvOAnlmHdP9o8BUDei7skyycy4q PVmIpGsv5MwQ+52pgGNxzOM5XwwGzaewtJxKwie250iVaBevhm9bAPUWySyBZrqJjbxA esBw== X-Gm-Message-State: AOJu0Yz0mcAoE99kbzVdr5PI/ktBsPEF0E6JM57lJmOO5dtZrncETDY9 mMGOHlMmDf+5vrTt29n3sEgafJdpdJGEpxw8Z315Xfv8/kz5SBo9C1sc1skS2Jcs88aweTJzRA4 ufwoPJpFYJJ/ldGoPXVuqeIjA6ViHO+o= X-Gm-Gg: ASbGncv/GUFHADzvLOJVeSGnyHOt4sEFyoH83ANGwvajaNiGEKb0bQs7I+iyqjVzKPd iz1r6tmmkZoaqPhT2rHIB373n1OGTI7AhEvj1LakyLkclkrxb6JOT4LjW8YBWWj7x+Hq2RcAlfI 06qnjIXtYXwiSxbGM2nStelfAIyytPgxv2qCXoJot71fVRU5L7gWPzPQBR9nPXbmQf2cYMCs1Lk JECf6grwx6S5hHpAdnQqNhSxabvcIvwUmznqvdWsq10uT4Ed2ef X-Google-Smtp-Source: AGHT+IHSj+v3dCKvg/SGJ3e/ih2mm98khC/Lhnsro7LuNo00hcM6Anoe6RxpSU4rBx8MD3AZq1y4GQ6USgGhxKAcy6I= X-Received: by 2002:a17:907:266d:b0:b3f:f822:2db2 with SMTP id a640c23a62f3a-b3ff8226795mr184603366b.11.1759148758769; Mon, 29 Sep 2025 05:25:58 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Xuneng Zhou Date: Mon, 29 Sep 2025 20:25:46 +0800 X-Gm-Features: AS18NWAfjlkXLQclKmoXOGfTLZ9aunzsT89u5sVjAifglcIRdlAI3wvlpd9S66A 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 Hi, On Mon, Sep 29, 2025 at 8:07=E2=80=AFPM Weck, Luis wro= te: > > This is more of a question of capability and to make me understand how ex= actly AIO work in Postgres. > > Now that AIO landed in v18, I was thinking of a use case which has annoye= d me sometimes, which is inserting lots of data into a table with many ind= ices. What I am specifically =E2=80=9Ccomplaining=E2=80=9D is that index up= dating happens one at a time. Would it be possible/make sense to use AIO to= do this? > > Another thing that happens often is that an index lookup for something li= ke SELECT y FROM tbl WHERE x IN (1,2,=E2=80=A6N) where N is a big number s= uch as 1000 or 2000, takes a while, because (at least for versions < 18) it= took a long time sequentially reading the index for each value. I ended u= p having to split the values into smaller chunks and ran multiple queries i= n parallel to maintain a lower latency overall. > > Anyway, does any of this make sense? Could Postgres extend the use of AIO= to such cases? To my knowledge, AIO for index scan is still in-progress and expected to land in v19/20 or later? [1] https://wiki.postgresql.org/wiki/AIO (not stay-up-to date) [2] https://talkingpostgres.com/episodes/what-went-wrong-what-went-right-wi= th-aio-with-andres-freund Best, Xuneng