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 1w8lKV-000qsk-1Y for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Apr 2026 20:41:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w8lKU-00E3Yd-1D for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Apr 2026 20:41:22 +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.96) (envelope-from ) id 1w8lKT-00E3YU-37 for pgsql-hackers@lists.postgresql.org; Fri, 03 Apr 2026 20:41:22 +0000 Received: from fhigh-b6-smtp.messagingengine.com ([202.12.124.157]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w8lKS-00000000PjL-1g7B for pgsql-hackers@postgresql.org; Fri, 03 Apr 2026 20:41:21 +0000 Received: from phl-compute-07.internal (phl-compute-07.internal [10.202.2.47]) by mailfhigh.stl.internal (Postfix) with ESMTP id 3A8AA7A020D; Fri, 3 Apr 2026 16:41:19 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-07.internal (MEProxy); Fri, 03 Apr 2026 16:41:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1775248879; x=1775335279; bh=fg79uf7ac4LwdJOXYW/E0JEXghno38VYptMRsfvWiuE=; b= m+USZxC+fyrVd7jdLWZw/GMcyY7qOBsHHghj+mAWUe/ZxIHmjKVGQs+wDYYJsiW4 401xlteVaRoIfn3su8bBx8xqrhFZP4wWT7suIWHQk7qoYDH55po1HL3lGtu85tZr RxRNJu1sMf/4CVBC515M0Rtx3pJq8YJhP9xpsrrOROWZDdnjog+kHpYuVao9re18 +E3Lp7NcuppG8zofhyBSuDHKDCyoyfIElIECAkp6VOyUBHu7mkrOAZMIQDmPjE2s 4x2bu9EpUdm3ivVCsAp8VvR/eqB6+q0LkmPhKv8ewG6wU2M6rB6lWBAV5/Xtv38E vFeqMfRzaGU5k5oELVyvwg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1775248879; x= 1775335279; bh=fg79uf7ac4LwdJOXYW/E0JEXghno38VYptMRsfvWiuE=; b=c rp+6WoBbTZKIcXlyjaVZvC2Juy98VHiqV+7SesSzAXrRUCK4/vNYNvhWAEal5XAr baGWuG2AkHTEH9+fyEu3EyxCU5k1d7EaX3RS6hTcGmcezTTLftJASego6QK0OgUP 8Bxa9X8rz42BRY4WD0jCBA2IGHGyta1EPhWVqTlaR8Pfc1SPoI4ZeCt5j/lPTYvW 19uzXij80JzJ6YkWV3XljELzSPqS7Lu7ul5n7enWt8NiFyWsoMrs+p1/f5sHdtBz GlA48XhKinInGA3safPifCILDCGwn2a0ZawK9jZD5TIuHzHm2iYeZYHqRIhdmBkT KaPIt5uk1RAnQMm/6ulcw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdelleefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceurghi lhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurh epfffhvfevuffkfhggtggugfgjsehtkefstddttdejnecuhfhrohhmpeetnhgurhgvshcu hfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtffrrghtth gvrhhnpedtleelvdfgjedvffeiueekfeeuleffhfegfffhgfffkeevueehieehhfeigffh vdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnh gurhgvshesrghnrghrrgiivghlrdguvgdpnhgspghrtghpthhtohepiedpmhhouggvpehs mhhtphhouhhtpdhrtghpthhtohepphhgsegsohifthdrihgvpdhrtghpthhtohepthhvse hfuhiiiiihrdgtiidprhgtphhtthhopegshigrvhhuiiekudesghhmrghilhdrtghomhdp rhgtphhtthhopehmvghlrghnihgvphhlrghgvghmrghnsehgmhgrihhlrdgtohhmpdhrtg hpthhtohepthhhohhmrghsrdhmuhhnrhhosehgmhgrihhlrdgtohhmpdhrtghpthhtohep phhgshhqlhdqhhgrtghkvghrshesphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 3 Apr 2026 16:41:18 -0400 (EDT) Date: Fri, 3 Apr 2026 16:41:18 -0400 From: Andres Freund To: Melanie Plageman Cc: pgsql-hackers@postgresql.org, Thomas Munro , Peter Geoghegan , Tomas Vondra , Nazir Bilal Yavuz Subject: Re: AIO / read stream heuristics adjustments for index prefetching Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, Forgot to send this one earlier: On 2026-04-03 11:46:59 -0400, Melanie Plageman wrote: > On Thu, Apr 2, 2026 at 11:47 AM Andres Freund wrote: > > > > What do you think about the updated patch to achieve that that I posted? > > here is some review on 0005 and 0006 earlier posted > concrete things: > ------- > - I’d reorder stream→distance == 0 in read_stream_look_ahead() (and > issue), I found myself asking why it wasn’t first It'd not be correct in should_issue_now(). We can't move it before /* there is no pending IO that could be issued */ if (pending_read_nblocks == 0) return false; because then we'd trigger a call to read_stream_start_pending_read(), without there being a pending read. We can't move it before /* never start more IOs than our cap */ if (stream->ios_in_progress >= stream->max_ios) return false; because that could lead us to exceeding max_ios. Greetings, Andres Freund