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 1urkWv-00BmoD-Cq for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Aug 2025 21:51:38 +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 1urkWu-004wZM-Qr for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Aug 2025 21:51:37 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1urkWu-004wZC-8S for pgsql-hackers@lists.postgresql.org; Thu, 28 Aug 2025 21:51:36 +0000 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1urkWs-002FuB-1I for pgsql-hackers@lists.postgresql.org; Thu, 28 Aug 2025 21:51:35 +0000 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-2489b6b6cbdso1849955ad.1 for ; Thu, 28 Aug 2025 14:51:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1756417894; x=1757022694; darn=lists.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=CZ6yEgaP14scIP4u4Rhk5uH2+GQL4jmQZaaATnSxlso=; b=icHjr2QF7Ue/cMTIi8NkXONFH9D2lglTkknaBw0gA/e92KmBL2xnE3n4+4bCmd141g 3n/tEcEb7IaNBQeKy3jdUrkVNHAcrVW5MsVVyxaMwwgdfPNc3yEqz/26ISoGE/kr8uJG lilDUqRubEexKVuS18GxeCKnzMQUXAidFYhU3T2mpZdTDYby+0XRjxS0CCEJAd6u69gg aLMBpEWc++YGzw6VRLC7t894eNsNWmGmk+dc0TdotaozlWB0iNY/bvfta9rQP1YYxiQs peBJS44/yQSmObil3URpsO3bG4HFUepP0k6x++kXiqdv1TqiChVoY7la4t9RCWrVbYYD dvIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756417894; x=1757022694; 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=CZ6yEgaP14scIP4u4Rhk5uH2+GQL4jmQZaaATnSxlso=; b=CJtp7p9hHSkNbLkNm+6efYI6CteHJuXQpai0PRMoYv3KE3TXcfhZTecVNSjNutQT09 W7V4pkzvKG5sOL/vLG0R4h1D1VFFXLaKvkW0grNCXfsTe53m23DpZPTVx3wg7A4aNEtp Q3PbGQ2spk4FpXNfApN5eXkqby0kggKuJoZ2BnNhtbpQqFwRikxSMSCPv7ZgyqoK6g7L wi3DYIXuYuuOBJX711kV5ouTv02QYqPn2agujse/p22Dzw/XK6kCL/M28aGaKlbRZipW 5BFeDZueQqypyCxXF/Lh4jIW3AQo/60907lUcxVKh1jkwoOkMpN23DksuHxZ73SxH/ab D16g== X-Forwarded-Encrypted: i=1; AJvYcCUgTxaTEJaln6YPlI7jffgCy5CrgAk1DS91T8rxp8Ina38Nwf327JClrauILESTOZPpcswYnGQH+Q0RYFhC@lists.postgresql.org X-Gm-Message-State: AOJu0YzEleGCWM0y2xF36XPDUtfVp/k0P9HUGF7XjCcdwBykJVOQEAOd Ibeu/5qhk6augVh8Tcq2Kxth99/me+Hd5ez7nCz8fTvtYpRhYDSKvycANmDjILmRGGwhMhvxZye rcQZkPNBK2iRkPYeqIkb6PymOmlVKPcE= X-Gm-Gg: ASbGncuLTfNaJ+QKv7bstuUro5BE/geugzlB23UbZYLzhlwSMP2rAQiMoDWB5EnJHAu TY59yW5RM7eR07j9c74II4h0OzKVtXXtLgL4gZehiDY9xtJbInHoc5Qz0aeT/DLrJHDoIO3xZyF 0ziBY2AeLgTTGNdxc36zRppis6U/VScKDd0rBg8zwdM/aZs9dQwmuLTH+XTHtPM1t/ZQt+fu8iM olRGoW9eBkcnSzN0DxMnuI3Dz4XTAgEkNdogWDZCw== X-Google-Smtp-Source: AGHT+IEqp3SMpRAAHIt4nBr2ujg/NhhDa1llNbhZ1GzpZCsDFI81tGe+MceebO033hiAcRvDutSNmD9SHATdBQ4vmbc= X-Received: by 2002:a17:902:d506:b0:246:b1cf:fec2 with SMTP id d9443c01a7336-246b1d002d1mr130789965ad.4.1756417893901; Thu, 28 Aug 2025 14:51:33 -0700 (PDT) MIME-Version: 1.0 References: <5v2wuxg65l5e3s6uf373zskcqqoukmraxiucnvgn4t7b5cmeqx@5mhqsurdj6xn> <6butbqln6ewi5kuxz3kfv2mwomnlgtate4mb4lpa7gb2l63j4t@stlwbi2dvvev> <0dd33755-cab8-49c8-b1ed-698732577fbb@vondra.me> <1c9302da-c834-4773-a527-1c1a7029c5a3@vondra.me> <6d59c277-c440-4d1f-a46e-157958c06a5f@vondra.me> <5pltwb73d7cynsxo2yb54ygjk7haviatkrx43mnzihc6kkield@ahnstpgof46i> In-Reply-To: <5pltwb73d7cynsxo2yb54ygjk7haviatkrx43mnzihc6kkield@ahnstpgof46i> From: Thomas Munro Date: Fri, 29 Aug 2025 09:50:57 +1200 X-Gm-Features: Ac12FXy5_BMx0LdzC7GUDk07EeY5D3sn86yOIY_6uGtEAxm8NB-9Cqj3LIZzpkk Message-ID: Subject: Re: index prefetching To: Andres Freund Cc: Tomas Vondra , Peter Geoghegan , Nazir Bilal Yavuz , Robert Haas , Melanie Plageman , PostgreSQL Hackers , Georgios , Konstantin Knizhnik , Dilip Kumar 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 Fri, Aug 29, 2025 at 7:52=E2=80=AFAM Andres Freund = wrote: > On 2025-08-28 19:08:40 +0200, Tomas Vondra wrote: > > From the 2x regression (compared to master) it might seem like that, bu= t > > even with the increased distance it's still slower than master (by 25%)= . So > > maybe the "error" is to use AIO in these cases, instead of just switchi= ng to > > I/O done by the backend. > > If it's slower at a higher distance, we're missing something. Enough io_workers? What kind of I/O concurrency does it want? Does wait_event show any backends doing synchronous IO? How many does [1] want to run for that test workload and does it help? FWIW there's a very simple canned latency test in a SQL function in the first message in that thread (0005-XXX-read_buffer_loop.patch), just on the off-chance that it's useful as a starting point for other ideas. There I was interested in IPC overheads, latch collapsing and other effects, so I was deliberately stalling on/evicting a single block repeatedly without any readahead distance, so I wasn't letting the stream "hide" IPC overheads. [1] https://www.postgresql.org/message-id/flat/CA%2BhUKG%2Bm4xV0LMoH2c%3DoR= AdEXuCnh%2BtGBTWa7uFeFMGgTLAw%2BQ%40mail.gmail.com