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 1vsZ4B-007QAK-05 for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Feb 2026 04:21:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vsZ4A-00DmVY-1A for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Feb 2026 04:21:34 +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 1vsZ49-00DmV7-23 for pgsql-hackers@lists.postgresql.org; Wed, 18 Feb 2026 04:21:34 +0000 Received: from fhigh-b8-smtp.messagingengine.com ([202.12.124.159]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vsZ46-000000019zm-3YIC for pgsql-hackers@lists.postgresql.org; Wed, 18 Feb 2026 04:21:32 +0000 Received: from phl-compute-12.internal (phl-compute-12.internal [10.202.2.52]) by mailfhigh.stl.internal (Postfix) with ESMTP id 1F1FB7A0036; Tue, 17 Feb 2026 23:21:30 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-12.internal (MEProxy); Tue, 17 Feb 2026 23:21:30 -0500 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=fm3; t=1771388489; x=1771474889; bh=hzMWfBOsjCHJ4PGBaMdazJVLhaBJAkOWkADjC8wIWOs=; b= qRqXJWOjLw+slDh019rQ/koOfA5XfDfJBk9FSDCA/xbRWieVnttF3udsBBN/tQ60 zl6Iufrfg9cr4Y51AHATSF2Prmwhw/Ru0y32G9weiM6jmnLfIO2UTYEca3wL+h9x 4qhSn1KeStUZHPd+295/gcteaUfQI0DYbIOjGtF0sTIKexVD1SgLczLDXQ1Cns/w e4ZfDEj1FBHihsjskMZlcxnzVwA8rrk4Hc61buxlumbuxf5H6zoj64hVdS/FDa2v PX0hN9SES/eUn45LW+hX3B7xGltfbbLYsLMVkn6vZriZ8UQkZyY/h8DuFr/z+M0+ 7QDyZHlcvxN08bgqwR4W9A== 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=fm3; t=1771388489; x= 1771474889; bh=hzMWfBOsjCHJ4PGBaMdazJVLhaBJAkOWkADjC8wIWOs=; b=Z ZPlCQLCKfbNkh5meHY0DZoDkLHqL/bLjjRB7f9GyNScMh0gydTL7Cfot4e1UxpQV +LAf5LCWPI8xfiWWxdO47zrmAK/xVoY4nKL2ktPUJ8/+SRBIcow3XRyz0nAARNiL 5eoQFmFDhgxO+JQgN5G7kOfVxZduOb7V78uczIrEtivveB1DaSnf2dXHavdi+GKy /a3ELs3ax6d4VH2WM2DpMNV6MGNwibtuU7YfJ3adwnhT3yxukZOrDuc8vFMDkGOr ebZv7mx6oPtk8qemejXGTbaU9SCUhl1lhzIlgqIhpgqw14eJcGSyKdejHnxWG6HI /x27TB06ql9PjFPo9h6Ng== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvvdduieejucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkfhggtggugfgjsehtkefstddttdejnecuhfhrohhmpeetnhgurhgv shcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtffrrg htthgvrhhnpedtleelvdfgjedvffeiueekfeeuleffhfegfffhgfffkeevueehieehhfei gffhvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grnhgurhgvshesrghnrghrrgiivghlrdguvgdpnhgspghrtghpthhtohepuddupdhmohgu vgepshhmthhpohhuthdprhgtphhtthhopehpghessghofihtrdhivgdprhgtphhtthhope hknhhiiihhnhhikhesghgrrhhrvghtrdhruhdprhgtphhtthhopegshigrvhhuiiekudes ghhmrghilhdrtghomhdprhgtphhtthhopeguihhlihhpsggrlhgruhhtsehgmhgrihhlrd gtohhmpdhrtghpthhtohepmhgvlhgrnhhivghplhgrghgvmhgrnhesghhmrghilhdrtgho mhdprhgtphhtthhopehordgrlhgvgigrnhgurhgvrdhfvghlihhpvgesghhmrghilhdrtg homhdprhgtphhtthhopehrohgsvghrthhmhhgrrghssehgmhgrihhlrdgtohhmpdhrtghp thhtohepthhhohhmrghsrdhmuhhnrhhosehgmhgrihhlrdgtohhmpdhrtghpthhtohepph hgshhqlhdqhhgrtghkvghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 17 Feb 2026 23:21:28 -0500 (EST) Date: Tue, 17 Feb 2026 23:21:28 -0500 From: Andres Freund To: Tomas Vondra Cc: Peter Geoghegan , Alexandre Felipe , Thomas Munro , Nazir Bilal Yavuz , Robert Haas , Melanie Plageman , PostgreSQL Hackers , Georgios , Konstantin Knizhnik , Dilip Kumar Subject: Re: index prefetching Message-ID: References: <64a2re223ajj4popowsyu4xekbuvvyfwkrihn5yzyrkwsmsuvp@2lls3tpww5dl> <52512325-b1f2-4fff-819e-f68122b2e427@vondra.me> <64mfcfv7iihc4pmqlxarii4esnmqry52ckz5m7lmwylnfnuxuz@oxh4ioxkjtep> <720560ca-97b9-40a1-ad40-9f9b8a6648e9@vondra.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <720560ca-97b9-40a1-ad40-9f9b8a6648e9@vondra.me> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2026-02-17 22:36:53 +0100, Tomas Vondra wrote: > On 2/17/26 21:16, Peter Geoghegan wrote: > > On Tue, Feb 17, 2026 at 2:27 PM Andres Freund wrote: > >> On 2026-02-17 12:16:23 -0500, Peter Geoghegan wrote: > >>> On Mon, Feb 16, 2026 at 11:48 AM Andres Freund wrote: > >>> I agree that the current heuristics (which were invented recently) are > >>> too conservative. I overfit the heuristics to my current set of > >>> adversarial queries, as a stopgap measure. > >> > >> Are you doing any testing on higher latency storage? I found it to be quite > >> valuable to use dm_delay to have a disk with reproducible (i.e. not cloud) > >> higher latency (i.e. not just a local SSD). > > > > I sometimes use dm_delay (with the minimum 1ms delay) when testing, > > but don't do so regularly. Just because it's inconvenient to do so > > (perhaps not a great reason). > > > >> Low latency NVMe can reduce the > >> penalty of not enough readahead so much that it's hard to spot problems... > > > > I'll keep that in mind. > > > > So, what counts as "higher latency" in this context? What delays should > we consider practical/relevant for testing? 0.5-4ms is the range I've seen in various clouds across their reasonable storage products (i.e. not spinning disks or other ver bulk oriented things). Unfortunately dm_delay doesn't support < 1ms delays, but it's still much better than nothing. I've been wondering about teaching AIO to delay IOs (by adding a sleep to workers and linking a IORING_OP_TIMEOUT submission with the actually intended IO) to allow testing smaller delays. > > That would make sense. You can already tell when that's happened by > > comparing the details shown by EXPLAIN ANALYZE against the same query > > execution on master, but that approach is inconvenient. Automating my > > microbenchmarks has proven to be important with this project. There's > > quite a few competing considerations, and it's too easy to improve one > > query at the cost of regressing another. > > > > What counts as "unconsumed IO"? The IOs the stream already started, but > then did not consume? That shouldn't be hard, I think. Yes, the number of IOs that were started but not consumed. Or, even better, the number of IOs that completed but were not consumed - but that'd be harder to get right now. I agree that started-but-not-consumed should be pretty easy. Greetings, Andres Freund