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 1vwQ3n-005flW-1a for pgsql-hackers@arkaria.postgresql.org; Sat, 28 Feb 2026 19:33:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vwQ3l-00BJuQ-3B for pgsql-hackers@arkaria.postgresql.org; Sat, 28 Feb 2026 19:33:05 +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 1vwQ3l-00BJuG-2E for pgsql-hackers@lists.postgresql.org; Sat, 28 Feb 2026 19:33:05 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vwQ3i-00000001lnz-2akG for pgsql-hackers@lists.postgresql.org; Sat, 28 Feb 2026 19:33:05 +0000 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-43989bd056bso2679846f8f.1 for ; Sat, 28 Feb 2026 11:33:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772307182; cv=none; d=google.com; s=arc-20240605; b=lkFU9kjNo/BBqCgBwz9YPkC38eQfjYx8Q0Oy+AN1NaGGHpqLCRzHmSbzwpt9KuCB7l J5/Ax3cys/eIdYqcmVCj8flXGYUE8bZl2uBgEjxOwRUbgmdWnLVsnYVRAHpFPIcGCR8T HONJwP2wPyfEIWYo0AWXhVeULvqrJcWr6BN2MAeCN9D5M56Pcn9hT0GzsBTxrGVJEs+y MH8EoyjvpmOMCeyfBbTxgYgqRrirfVNIlXJGEaPncAWe2k3UnfJ0QVyxkDU5+cXTipcm +xf21hN1QZ/drHfzTIf279Cporx7NHWYNmVRkWqOaDEu3dMX5r3LVm7uVl33imOrTRpy Au3A== 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=UXZkS6oqLHIjp0lpNu+4frSLFOsnG/08v9eK/2SEtsw=; fh=5Cavs9RfXxmvtC0CJsuRuGSFrU68ovPX6hGCQjVq+8k=; b=My3cg216ZiZtLRmUz718rTWMPKTc41tDUapoIWmbvcqTxvzdtxN9Rc1IYGXGyWsRFh k4twPPGyXaacuwB41xk2UKKFwKG5ZFz/AcdfyFxYdkGxUs3dki2gieSfNkNlpv5TmVsz FvWpQ10IsOypIlmajoa4ZToqk4OP9iR/0ux14SO6/fGnsEoLGj+ZCCWF+kI17NqPfU4q +X968M/ajYBS7aTJWfBtI4OrZr0ey6ZiJuNnX1idjgPpV+j5O0Nd7Gx6pxHXSM2rz21X AoYmJEMH4s5eBrvlPqOEfZKHzQqp9xYyH3bvJgLRSoKWb4no+UiKcJDfQcne3A3vhqXc khJg==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bowt-ie.20230601.gappssmtp.com; s=20230601; t=1772307182; x=1772911982; 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=UXZkS6oqLHIjp0lpNu+4frSLFOsnG/08v9eK/2SEtsw=; b=lkVlUFLkL376v4H2vP18JTGN+ymzst1BzcSw/TJDvJu1wyuhj6J7wDBsbYN7BdYcBf vAJfJq3hTYHS8CrD1RyoBUITxJ8ncmb6WbThhv/AWUjjzF0BVw/ue+NPfDvCpzhbaRzD 6WhjPE9C4kwxRFdxKhE0D4HP2/OuDuySc6JlLcICD1W9qFA1dRFC3NsW/8r8d7/MvbNQ TyAYsAuYGeiK88r4zDuKTnJgxS8h0h7uI/nlE8Y9FO17xXUmMqYl6wsN6F9aXvqFsx3r y4z5cf7V1iDSBZUY7sdGp0+pLzmsX58+O8T0Aw0d4C+Vm4eSLZ26bnk/zSDlQWMN35bz A5MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772307182; x=1772911982; 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=UXZkS6oqLHIjp0lpNu+4frSLFOsnG/08v9eK/2SEtsw=; b=QigjWLO2t+pNZDsJ7JpzKXUM7gPe/rcSBM+zMZWyHmNNOmDrVBjtNH1gybRH6Rq5ub CC85N/7+rAM51nKYutqEfIyLFzWU+TGo50DZlHVOpCMJG4uL8UCNWmB2auZB4y6SLXpx gPInhwqVHc6Yna2bzRQVGBgwRR+Dsy301AmrEQ0tC3bfl8wDup7hs7qCxsiYnwdaGMZh 1sW/szYZ8WAm2w/3Z8rzaz4eqOHtKHJrelZjw+mdinNS8S3xdhL6cn2QAH7VkMUcWRaX 76mA2J9SJtp+W8SWqdO9mcXgS6KBo74tJ2xV/+KX0NiZ2utOHmi8BsstZvYod4md5slN /PKQ== X-Forwarded-Encrypted: i=1; AJvYcCWyCahv55cIZujnEHGTNcMq7sAoo2xpI988/SONIOX9GDIt1z49qE7z2bdgeBsleYEV7y3UiGgnzLjlkTGQ@lists.postgresql.org X-Gm-Message-State: AOJu0YzSN9EMjw+iWQHbWfNz3qiRdmsbXSQBJPFbId8DVGJhQ2WhNvwH HJA1By8vkW6kUU0/0Sb1kTv8p2R3jq/E77skYhmBPngevmKZ1439VmkQYuHlSKmIDwEgjOFZben 4gxTsBhSwl8o4RzVGi0y12hWgNCNy85RXFpILzv5pIQ== X-Gm-Gg: ATEYQzzdQMuQOVZhzCw71MTILtn63fvgXP5MpT1BOYu4ckHezNrbOFG7lBC+SyJolcx Z0oy7ihsXQIPUVUZ7mwdw3d56VwfR7346NNVNgM5a/sy/QaCl6m0ydYoDZ9NaVCY5WLwP/YP+d1 mYSfSQZjme7Vt0nDkAbfcp2NpDCldgm/QNEAkuon3VURxe609Ykox1tuyZ8OuKBGTBB2z8ZRxSS OrhcE8M+zEoQH0ZmIHwbQ0Ke4i1TZj71IYa/f6cjeXgooIJ9Icntxokt36nSFn2afTZDE5tAMSt kVIdeyA= X-Received: by 2002:a05:6000:22c9:b0:430:fd0e:a502 with SMTP id ffacd0b85a97d-439971fca98mr19769184f8f.22.1772307181744; Sat, 28 Feb 2026 11:33:01 -0800 (PST) MIME-Version: 1.0 References: <52512325-b1f2-4fff-819e-f68122b2e427@vondra.me> <64mfcfv7iihc4pmqlxarii4esnmqry52ckz5m7lmwylnfnuxuz@oxh4ioxkjtep> In-Reply-To: From: Peter Geoghegan Date: Sat, 28 Feb 2026 14:32:35 -0500 X-Gm-Features: AaiRm52WxW_LKLFRLdIeOX2TxLQ0UMrknvnxz7BLPO2UlKQMIQ6thc_VR7pM5yo Message-ID: Subject: Re: index prefetching To: Andres Freund Cc: Tomas Vondra , Alexandre Felipe , Thomas Munro , 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, Feb 27, 2026 at 7:37=E2=80=AFPM Andres Freund = wrote: > I do continue to wonder if we ought to pass down some hints from the plan= ner > about how much data an indexscan is likely to read to influence readahead > aggressiveness. As you know, I already have some of that, but it isn't particularly well developed. I agree that pushing the hinting mechanism further and using something like your proposed READ_STREAM_SLOW_START mechanism (which you mention in your later email from today) seems most promising. > I do agree it's right beign concerned about the increase in index fetches= with > such mark/restore cases. > Is this, by any chance, with starting the server and running these querie= s in > that order? Are you repeating these runs within one server start, evicti= ng > the buffers inbetween? Yes, I repeat the runs 3 times, evicting/prewarming as needed each time. I go with the fastest run. > Are you using huge pages? I see rather differing performance results > with/without when not prefetching. Yes, I always use huge_pages (and never use transparent huge pages). > It really shouldn't be sensitive - that query will never be able to reuse > heapam pages within a query, and evicting a clean buffer isn't that expen= sive. Could have been my previous failure to use "cpupower idle-set -D 0" to get maximally stable performance for my microbenchmarks. As discussed privately, I've added this as yet another step in the script that automates all this for me/that prepares my system to run a microbenchmark. --=20 Peter Geoghegan