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 1vrX3a-009DQT-1N for pgsql-hackers@arkaria.postgresql.org; Sun, 15 Feb 2026 08:00:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vrX3Z-000qRF-0v for pgsql-hackers@arkaria.postgresql.org; Sun, 15 Feb 2026 08:00:41 +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 1vrX3Y-000qR7-2Y for pgsql-hackers@lists.postgresql.org; Sun, 15 Feb 2026 08:00:40 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vrX3V-00000000i0r-4APS for pgsql-hackers@lists.postgresql.org; Sun, 15 Feb 2026 08:00:39 +0000 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-b8f7a30515aso290630266b.0 for ; Sun, 15 Feb 2026 00:00:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1771142436; cv=none; d=google.com; s=arc-20240605; b=Kt7PUlQoUqeAVZwvXdhuDKO2fujeTibstHjNuLsQLtZFcZp/8p2W10YvjbhHxtdeGS +IcqZB5H0wW3+u5Pi0nCgCQQezcp1AOXElsFiDWIB2KMyyEjdxPPhmNv4e0b52KGF/Fv /ZZT1Ra6b1Hmc3igLOfb37lt9fCtKpoGiHiNbdC/+b7/Fj7heYb11p57oFveb6u/9SNX 3ST1s6laPBxyGz1CRBBns9HfWEwsPaz4lj//PBz6h1MXA7itsN2zFrx44Xmev6V3Itiw aARKThOPchIy1JmoL6mYssykTlaSDfGYxvkGSYVm8loc2NxIutGPCFVUgEM2q+nqKAmY RbKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=PGY2JbL6SvbrhRYisukQuv2n8DlSIp1GFqHOO8fTFiQ=; fh=NrUp4jYL03LsVR6FjbjQDdAWyxzWbD6tndMJvONlhBc=; b=b1geN+KtlKekFyq7W0Gp974GMqlljgxYyaL34KY5ShV6SO73ap93kC6pTulvsc2CMq L9FCjIoJp1xkQRd0YZ2fo5FimjycOr3PwtTkzjWFnquADCypsS8UzwiV+UVqxJUtPoIu /M+Hydd5+ozDavrjW8zSb/sKOY1sMAV4yQhc3rNEXGZ9w/vE5wvBQdJfyIXZVHQb73Sp JmypvPzAgCswo2M74bDmZKJTMl/89vNgAe14P7gY2GsTg7OVpy1I1y1m8/TEtH2IHItz QB3I6g1XnJcH2fasIl66NYvq2bPNMh4mV0yao/qnR7jMDbw7HDyB00+937rmMUcTWZWe PzSA==; 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=gmail.com; s=20230601; t=1771142436; x=1771747236; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=PGY2JbL6SvbrhRYisukQuv2n8DlSIp1GFqHOO8fTFiQ=; b=m/JO1bvj9yg5Bq2wq72DJgPM9hO8FtIUhEo35scUZXp3l8CcX5+474zXwkEwIbydPm KvT6BjjbcRswt7Gd/z1RwpZ6TCFPfjb1UocyYPzcmRUxGxJjF416rod0dF2WSHoYvumh 4Iu8kDmqMdJLtjKTO2Rj2fEpQGZGbl5PNISZN3TWATp8B3vVs+LPwCvSxvhIP0QcqF2s EX5njNZqhOwN8PXRtzeSnkuhCNSSsVvUy/k7mQ0mit/+7ugYhQIVKs6qmE1EqBjryZgn +iujPc5iapLKUhT0ta7WZBWRyog4A/wsnlFlF+TQVRM96KtMEyEgxi+1iehN2/h0sWrq tL6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771142436; x=1771747236; h=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=PGY2JbL6SvbrhRYisukQuv2n8DlSIp1GFqHOO8fTFiQ=; b=NNg12TclspHk3913QI7daATTKPh3HopR0gwvxIlqKCk77U5J4uh1nUSQt+vZ7QvwUd dksY2wqCxqoRClP7ymd6EfCk4dKtWVKWoYnJU1A0/XF9igmtVaXjLlE1FO/gSOlO5l1U zEMEt9cUynP3vCAgcnMtYAot+YzqVTmwhOggvX4Tl89qq2bjDhCUa7WwNfxJGAet70t1 AzI+dzBYt2mvDNv2p0j7TtWqXJZvfws/wFsoCXCk9nbR+h3W4KXdKQYJ+Ce4yAFA6gDT CIraZfqvmxRnopnb08HTvvt/hsz7YX4vrAwOni1P8h1di0NbZtKs0SGVO6NFVfZFAs3u iGew== X-Forwarded-Encrypted: i=1; AJvYcCUNIcw7RtYtWnfFRx5KS80s/NYgheMgW1EwMoHraGCXvUWNn32trnHFbkSiE8S8tE1STfQjmu+3QAg03uA4@lists.postgresql.org X-Gm-Message-State: AOJu0Yz/lHWh+aD/SuGY/SYyOIBOMv64hxvn/wjK0ooacAOmEaa2Pp89 r9PimMmF4Fd9fs+xs6HvsP6A9wXKXPRTfF6VNYSnFA0RUgfWONr0op/IMTpDT38AaRfm5fN0Rmv XDN3Lv97vL0ePpf7BFLixJxWsfpJOT/U= X-Gm-Gg: AZuq6aJLI+xk9ywQHs8LcGz7c1TnJjCRAEipHSbiS06YM0t+m/cdgMivwRDi4wQf/zl FY6u++7ZNdjlM/bheh4X8+H+2jT9WeAVczsQPb91HVnfZo2R+P1MGFVYJK5U794YuS7JxQmyME6 vrpvELRx9vndlHgVbQk/2ZasxTTpiWXT1j+DSMvh/GwGrQs0L06WJ0Aop011psBlB0wuT0rDcB1 kgKfWcg5u6nY+2lMQ/pbeZo0IyyG6vgMzdSRsMPW3avzXGKDrFoK9tufFlP4AZtL0TSIDaUs3NF TVZv6sLNjhl+bwcyJNQdBAWoKnplW3xzpXPOS5lxPc7PYuITkpU8lFQZYVFa X-Received: by 2002:a17:907:9453:b0:b73:758c:c96f with SMTP id a640c23a62f3a-b8fc3cee949mr229476566b.52.1771142435725; Sun, 15 Feb 2026 00:00:35 -0800 (PST) MIME-Version: 1.0 References: <6d59c277-c440-4d1f-a46e-157958c06a5f@vondra.me> <5pltwb73d7cynsxo2yb54ygjk7haviatkrx43mnzihc6kkield@ahnstpgof46i> <931afce3-8c86-4c96-9861-0ffa17c6560f@vondra.me> <4zeu5yb73byiquvf3eefsunnrydyqfxy3eup66jrliutrtd4xl@5iifjey4n5m5> In-Reply-To: From: Alexandre Felipe Date: Sun, 15 Feb 2026 08:00:23 +0000 X-Gm-Features: AaiRm50NFfNYMJ6k3-iQXh0isNtkPKkUc9e7AaRn03qEa7wDekCzUOFdcKsgOAc Message-ID: Subject: Re: index prefetching To: Peter Geoghegan Cc: Tomas Vondra , Andres Freund , Thomas Munro , Nazir Bilal Yavuz , Robert Haas , Melanie Plageman , PostgreSQL Hackers , Georgios , Konstantin Knizhnik , Dilip Kumar Content-Type: multipart/mixed; boundary="000000000000ba9c55064ad83b61" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000ba9c55064ad83b61 Content-Type: multipart/alternative; boundary="000000000000ba9c53064ad83b5f" --000000000000ba9c53064ad83b5f Content-Type: text/plain; charset="UTF-8" Wow, quick response. OS eviction is only implemented in the python version. But the most intriguing part is that the python version also shows a degradation by simply evicting with pg_buffeercache_evict. I checked many times, first I thought that my differences had a sign inversion. Then I thought it could be something about the python speed, could it be? I am timing with explain analyse, if I was fetching the rows this would be the obvious culprit. How did you account for the OS filesystem cache? It looks like you > didn't, based on this run_benchmarks.sh code: > Sorry I attached the wrong file. I didn't use this run_benchmark.sh. > How should I go about recreating your result? This was my best guess > at how to do so. But it doesn't feel like a good guess. Could you try running the python script or should I provide it in a different way? > Are the numbers you showed comparing the patch to the master branch? > Or is it just comparing enable_indexscan_prefetch=on to > enable_indexscan_prefetch=off with the patch? Just changing the parameter. > Did you write all this test code yourself? > In the sense of typing it no, I used cursor, so I just edited what I could see it didn't get right. The results you've shown put the patch in a very negative light -- at > least if taken at face value. Please notice that I tried to be neutral in the narrative. Maybe because I tested on a MacOS maybe it works differently from the type of "modern storage" mentioned at the start of the thread. There's no point in speculating what might have happened here until I > can reproduce your results > I totally agree, that is why my first step was to try to reproduce your results independently. I see another message, checking that. -- Alexandre --000000000000ba9c53064ad83b5f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Wow, quick response.


OS eviction is only implemented in th= e python version. But the most intriguing part is that the python version a= lso shows a degradation by simply evicting with pg_buffeercache_evict. I ch= ecked=C2=A0many times, first I thought that my differences had a sign inver= sion. Then I thought it could be something about the python speed, could it= be? I am timing with explain analyse, if I was fetching the rows this woul= d be the obvious culprit.


How did you account for the OS filesystem cache? It looks l= ike you
didn't, based on this run_benchmarks.sh code:

Sorry I attached the wrong file. I didn= 9;t use this run_benchmark.sh.
=C2=A0
How should I go about recreating your result? This was my best guess
at how to do so. But it doesn't feel like a good guess.

Could you try running the python script or should I provid= e=C2=A0it in a different way?
=C2=A0
Are the numbers you showed comparing the patch to the master branch?
Or is it just comparing enable_indexscan_prefetch=3Don to
enable_indexscan_prefetch=3Doff with the patch?

=
Just changing the parameter.
=C2=A0
Did you write all this test code yourself?

<= div>In the sense of typing it no, I=C2=A0used cursor, so I just edited what= I=C2=A0could see it didn't get right.

The results you've shown put the = patch in a very negative light -- at
least if taken at face value.

Please notic= e that I tried to be neutral in the narrative.

May= be because I tested on a=C2=A0MacOS maybe=C2=A0it works differently from=C2= =A0the type of=C2=A0
"modern storage" mentioned at the = start of the thread.

There's no point in speculating what might have happened here until I can reproduce your results
=C2=A0
I totally = agree, that is why my first=C2=A0step was to try to reproduce your results = independently.

I see another message, checking tha= t.

--
Alexandre=C2=A0
--000000000000ba9c53064ad83b5f-- --000000000000ba9c55064ad83b61 Content-Type: text/x-sh; charset="US-ASCII"; name="purge_cache.sh" Content-Disposition: attachment; filename="purge_cache.sh" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_mlnfxafa0 IyEvYmluL2Jhc2gKIyBQdXJnZSBPUyBmaWxlc3lzdGVtIGNhY2hlCiMgR2l2ZSB0aGlzIHNjcmlw dCBhcHByb3ByaWF0ZSBwcml2aWxlZ2VzOgojICAgbWFjT1M6IHN1ZG8gY2htb2QgK3MgcHVyZ2Vf Y2FjaGUuc2ggKG9yIGFkZCB0byBzdWRvZXJzKQojICAgTGludXg6IHN1ZG8gY2htb2QgK3MgcHVy Z2VfY2FjaGUuc2ggKG9yIGFkZCB0byBzdWRvZXJzKQoKY2FzZSAiJCh1bmFtZSkiIGluCiAgICBE YXJ3aW4pCiAgICAgICAgcHVyZ2UKICAgICAgICA7OwogICAgTGludXgpCiAgICAgICAgc3luYwog ICAgICAgIGVjaG8gMyA+IC9wcm9jL3N5cy92bS9kcm9wX2NhY2hlcwogICAgICAgIDs7CiAgICAq KQogICAgICAgIGVjaG8gIlVuc3VwcG9ydGVkIE9TIiA+JjIKICAgICAgICBleGl0IDEKICAgICAg ICA7Owplc2FjCg== --000000000000ba9c55064ad83b61--