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.96) (envelope-from ) id 1w8PMN-000VFa-27 for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Apr 2026 21:13:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w8PMM-0083ls-1P for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Apr 2026 21:13:50 +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.96) (envelope-from ) id 1w8PMM-0083lk-0G for pgsql-hackers@lists.postgresql.org; Thu, 02 Apr 2026 21:13:50 +0000 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w8PMJ-00000000GLO-0nXp for pgsql-hackers@postgresql.org; Thu, 02 Apr 2026 21:13:50 +0000 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-b9bfcbaa81eso184236766b.1 for ; Thu, 02 Apr 2026 14:13:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775164426; cv=none; d=google.com; s=arc-20240605; b=HfagYVbVvecf11m/NZ6OePlUNnXkqdDwQ0N+cXUDPmK43OOjfdhFCczOYUsE3YuiGH BY2c5YTJ12AxKmf9huBB9Ws9/X8WW3iLO7wM++geh8xvY5X5jVmMf+ROfLABqVhqSryd 4qqMTSBJkTrf7dIyyHNMoLgmEmBx0X+Ljv9ZHkx3hyNDKAmO0tN6eo3AJj711ic3nGCs RgXsMgfwv9ycRhJyhlXUJ1+G0hThk7P24mYaPbIekKOV/43HkIHFFE4ffVtcloNJlOwx CD6PUo9T2eCz5j/FYrBkXEETZMVuxdzrjSdpG1K0eJPQYkK1uS0pTJ1xY0iTQfRp5Kn7 a/tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=5qOFkIbzeA0c463AB91+9YMd9D9Xfvs0QQLLE8pakPI=; fh=62GROJdbzln/QsGjE7a71YRuD5BIah4s1ki9oo1aJ7c=; b=ZweV2QRmnwUsHjd12YQASpNbTM4LjxUY9gU7BW5Ch0bVZjWPjm1M0J0W6O0lT26eQE 06ZL+PosCbID+ek7ey1fs/X9KvAOJuMZThRiuT8zg98ZV4cFGETvbIumnactsok3i3Vh YT7kVigihxCHPxrDb+rf+H/tWRjYJdhSmtA8nw9pMJfpweqg2652hvWEEa+g99D8RpOU jToEFIxjTRUSjDgNf6N5w8ZVnyOEg2ZoIXQcm+ArUehgYPbx0JIPZDbh+JRdETG5xFJv B02fPBJfLS5faiv15c0icA9ooc4rit1lyE8K88E/AhKokucmalDom3rnUpUjYuDhSWWz CFbg==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775164426; x=1775769226; 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=5qOFkIbzeA0c463AB91+9YMd9D9Xfvs0QQLLE8pakPI=; b=Orvk0ledBUI2B8ppKw2pz6P2UZT2yqjYBmSTM4IPKnk/f6ECbiVBV3KgyPUMlA/fW0 G+YyLSBSxq26n77uG1bAUanDCWyU6asI2XISP5xAQ0GrY1gn6rnY0WBiLLfiFmPfAqEo kCSYZ/ZKZK4opRBqiViPEFYkDVEz+RBVIC0nUssicWlQbe+0YJH+Ue0lIm2F4NbTl17z eVoyX9ofUOej4qU+mQcqfCWDAjHIDmC+r0MaZ+3bOHentRnQzO68Ov8PiwPvmQQDX2yM +kSiDkeaR9/5eUwUAzmnbyxihAW8CGcoNN+4UyMYCTAKyHiwPOJdK1DTl4lHQ0V7nFRY HRmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775164426; x=1775769226; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=5qOFkIbzeA0c463AB91+9YMd9D9Xfvs0QQLLE8pakPI=; b=UUaGlpfohD3XYJAFTZGA2OpkGRh9YWfx4VsXOSYGFzt2FzhgBHEAZu2ms/Ms5FqRN9 u/riTPDEQXb6MR8tVV0udZmlTjY2f6MqnD2zquYzBu10J2MD3uQstLCTmDHxlQschBfY znaJkXTdOYAgKGkq/+CWkLa9q6qfBXCgbDZuqG14tJ1PBIgl3ntZaCgjpWHzXPSzUCH8 RlWGAgJrb1KX9lglLl81lQTNN2XnNFa00R0zlDZNeQWpZl3j/C3KYr4c/GtkmYSr9S7R IhpOZjWO2INUDizbIpXIYx0Xg9hfYmlA3x8Sngt9YZh6JKKIjfjHwiBwwXHkPSa1FhUl MQig== X-Gm-Message-State: AOJu0Yw5M986if3cq8pKh7qKI5T6WpM2G0xNUmkOjli/OP+iKzL6opva GqsNbI3mipOF9d4PFJnCwheFAarXpb+6RwKe2DEFZu9zYzolon+DAommLuxi4u4hDk54Mgw6jBj Jn/2hQKPwo/fA3CpG6tIqnKE7eUh6K2E= X-Gm-Gg: AeBDiesCvwf4uZEyl7tMSAZMiEw7gHgoWm6pRYOLnt76vqIhfu5S2JLnrqMZgGwVVH6 FjFlSG+aIqt/NmgaJec2txGDOHHH2tnxBrriQALlhI8wbWs3D3omHOfSeVww5qdi7BpA/JdYpxg qcCaEQAF5QJeT2BX5cMa1qV12+EuZV2czJ97VB1+yloR37hnr9qQPUFWtfdIGGm/0zraEVzK60u Xxqs2ZEVG8hvOnRmfSnQbJbjvcyDy1xSKcHIrluMak2T9oXIVTRnd4KUXheEdTuGp4UdWkqZweT RRc0qYJHYdSl9T3MHQaeSkqL1Y77LAlMVHq82f5gHAGIBlGs6ip0oVwW0+TwtZ8LDqECbym7Dyb rTzLhtq7l X-Received: by 2002:a17:907:6eab:b0:b97:2a5:8a48 with SMTP id a640c23a62f3a-b9c67a10b3fmr19446966b.37.1775164425860; Thu, 02 Apr 2026 14:13:45 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Melanie Plageman Date: Thu, 2 Apr 2026 17:13:34 -0400 X-Gm-Features: AQROBzDF928ijs9S5kGgtgZmh4TnIskp6dA6QdOzu8QsoKLySkCb-IT4M7DHXOs Message-ID: Subject: Re: AIO / read stream heuristics adjustments for index prefetching To: Andres Freund Cc: pgsql-hackers@postgresql.org, Thomas Munro , Peter Geoghegan , Tomas Vondra , Nazir Bilal Yavuz 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 Thu, Apr 2, 2026 at 11:47=E2=80=AFAM Andres Freund = wrote: > > > On some level, relying on worker mode overhead feels fragile. If > > worker overhead decreases=E2=80=94say, by moving to IO worker threads= =E2=80=94we won't > > be able to rely on this to keep the distance to an advantageous level. > > I don't see why lower overhead would prevent this from working? needed_wait has to be true to increase the readahead distance and for io_uring, when data was in the kernel buffer cache, needed_wait is false, meaning the distance doesn't increase. Worker mode didn't have this problem because of overhead. So needed_wait is true for workers. But, now that we will have combine_distance, I guess we don't need to rely on workers having overhead. So we are saying that readahead_distance is completely irrelevant for copying from the kernel buffer cache and only combine_distance matters for that now, right? > > Yea, I think running ahead far enough to get bigger IOs needs to > > happen and can't be based on the consumer having to wait. > > What do you think about the updated patch to achieve that that I posted? Will post separately. - Melanie