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 1vrvae-00DML8-2g for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Feb 2026 10:12:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vrvad-001IiC-2A for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Feb 2026 10:12:27 +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 1vrvad-001Ii3-0q for pgsql-hackers@lists.postgresql.org; Mon, 16 Feb 2026 10:12:27 +0000 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vrvaa-00000000rz5-3SaH for pgsql-hackers@lists.postgresql.org; Mon, 16 Feb 2026 10:12:26 +0000 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-65808bb859cso3739092a12.2 for ; Mon, 16 Feb 2026 02:12:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1771236744; cv=none; d=google.com; s=arc-20240605; b=HgbIvfa32n/TR/sSZPCs65+1yB6RCm6kq8UXWakO5XrOZ8dw72rdU+bLw/qa5I7BZc l7DoP0sCor/RnoMiL0ZQmWUJjgTDVnxJwMDSnQfxbvaMATM2fpo5HAodc/+17kS2sUA9 0uwCh8qYh3ClnHrFeI+GP8nqJYQRo+g0+FXo9SaClhG/62iPVtV+RDH4PVI/dSdb62X5 HX36VvVfgwq8rZ4N2nNLUu8hHIDPiprcur7075Hel4kDDExJQy3BB81GAOMPtjgwqxfT ZHehXirI5mEuYpIWaD3AVzRjmcnsssKo+fpLHqQ82rIBqZ1kIL7L59TLb9JPremtMVOD tqaw== 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=H1h05520WcJaTW14/0nn11BHAo0zLvdfrVDxXZl6BBs=; fh=v8BbnHLi/DOMOusUrW0e/7RT+mHHUl7RIEMytoU/2Z4=; b=Hfjjy2Ktu7Q4Bm5NjUJMDJjdYmtlwIJVs5Daxjy3hXEtl6RwD7Vc6wNbjSdsIn3/Rp sNeN5eVScGNTntrCG/BLnqMjcEJ+yM9mGkU4V1J9Zucnc5PHDrZt+8cgRTLd8e02K9+p ez7nWsVlhyQ8nv+HTnsKynw+GTTYdwJjh+EydM815XrTNg8IJYDYLKasE0Tw0LevQtPX /JOHdVUJgvRk0E6/cmfiCioDWeATNJJt6KH+2JAiizJ8smfoYPnpoQgOu3j+wznjvOml 8PVKaD2WBitG7EnjAsT507RFGJ2Bbi5N2CK4u6yjDg5A3GUCIEM+cGA5xCejZQroH9kt DO5Q==; 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=1771236744; x=1771841544; 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=H1h05520WcJaTW14/0nn11BHAo0zLvdfrVDxXZl6BBs=; b=B9Li9EFfrnwJwwNQGfhiT4RleGhAtavzfNUuSGNBj7ZyrAUzUSa9rCbgd6IE0KlbR0 Vn6MPOs4WF4C2XNvd0SUaCmrb6lMR0dRtDYWOX48m9gVEN9A/LzXWpDs0vrWybSNrUMb xzcFAgNrKLaa+UIf9R5qKf1zLHPqQXeq8szeKfYWltgXAEzFw3z8U88iBk+9aVYH8Bj+ JD0+/AKsW4HtpQwSPix1M5nP8p0M8Cp823punNmXW1IteGTJ/UpymWB+W4IhzvTwL3NE XeWNaxe0zEdwp9thb6T3zYZYb3+uiyT37DW+nHVxTxUsXdeXyK3syJne5dILnefCYKTM EnLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771236744; x=1771841544; 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=H1h05520WcJaTW14/0nn11BHAo0zLvdfrVDxXZl6BBs=; b=bhxHR6VvwcMfiYfDVIlTCvl9ukRidIpMbjPYuIeyAxtLZjc0CvYYNr+RJGgpbu8Udj fCpZoeXVcySUeNrWIdMfHA/eHkrOxpAC2/cToQAOpKxBcHe8X9st2PtnhSDD7C0OMnBR Hb74eaWZ/X5DRDmL4QCarvGuldMEf3Nf2VZYETSQ86I2q7LjHNA1eGZofq005OLCYwgD /vdTxvB5YLpeZ29zeblqPpf6NIipb7/1LHzVXs5EBkl3OrjAqKeaPOKPqXpnJD3cjMYT rEuA97DWqlJV4/QO977T+f0JPg7a30qbhMw2juH/nxtmLQG+JfcjlAONfVjsezuU4YWu WkDg== X-Forwarded-Encrypted: i=1; AJvYcCV5SqjSL26X4oXRH6/8AcIsED0y5PcBBoWS5VKPtz2aDNPwkD04PWJz1oJ520eDwRyzAX1bV2tdoVkfFSiJ@lists.postgresql.org X-Gm-Message-State: AOJu0YwPfNVC/k7sTpaWWasX/crRmAg0pVbyFDxQ16EKoOtisJPporb8 iSz+BFq48UyeSqd+AyTIW3Hy/LG0bzDHCYjg81a7PVuCEJZ3n6fGT0yYeRGnh3WUYV8Xa1GogIn L6j+jsuEmEReVwBqMXKBBvKSLEL1P/0g= X-Gm-Gg: AZuq6aLTI103Z4RCkuKDUrkjbT8pQagRsIlGnfEzSqVoIghEPR5uOuVlBGj58oY1mMM K5OucGq37Mx+3icPRfyu3PvwokCLhdtY0p7QwyVipAaxt60mbAOzqZDiW4DupmG/LH+EvKUfnMb C8+232aPtVnnCy+5WKuWY4xELR6Drd1+HqtTm8loYnMNKA3PcyQ24yTrCSGoHNc4zKZrwtBHIJP hTHBUHtEvpZNmixMPopV/Keah8ADIIi+o0zP++hxDvwOlO610uWUfVH0EYcJ7ncX3Xkmmk0hMMz BddCLDBwIsZNRKKwU3PPFRzFmYmcYu/0QkeWImjWeV0H4hrjbg== X-Received: by 2002:a17:907:3d4d:b0:b87:35fc:ae5f with SMTP id a640c23a62f3a-b8fb450a24bmr500180566b.52.1771236743738; Mon, 16 Feb 2026 02:12:23 -0800 (PST) MIME-Version: 1.0 References: <64a2re223ajj4popowsyu4xekbuvvyfwkrihn5yzyrkwsmsuvp@2lls3tpww5dl> In-Reply-To: From: Alexandre Felipe Date: Mon, 16 Feb 2026 10:12:12 +0000 X-Gm-Features: AaiRm52iQux80C86lH1darnA-BxK57eYlREeXH2Id2EkgEA4hvSumOunkQoCzBc Message-ID: Subject: Re: index prefetching To: Tomas Vondra Cc: Andres Freund , Peter Geoghegan , Thomas Munro , Nazir Bilal Yavuz , Robert Haas , Melanie Plageman , PostgreSQL Hackers , Georgios , Konstantin Knizhnik , Dilip Kumar Content-Type: multipart/alternative; boundary="000000000000ec79d0064aee3098" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000ec79d0064aee3098 Content-Type: text/plain; charset="UTF-8" > How did you do that? Did you increase the number of rows, make the rows > wider (by increasing the 'repeat' parameter in the script), or something > else? Did you verify the table really is 1000x larger? > I increased the number of rows by 1000. I didn't really check the size of the table, the time increase suggests that it was right. > The "10k table row" means repeat('x',10000) when generating data? Oh, I > see you're using some string_agg(), to make it not compress. But note > that if it's TOASTed, it become entirely irrelevant for the prefetching > test because it's in a separate relation. > sorry, 10k row table, for the payload I left a note > [b] This time I used a (SELECT string_agg((i*j)::text, '+') FROM > generate_series(1, 50)) instead of repeat('x', 100), just to prevent it > from compressing to nothing when I try larger payloads, and hit the > TOAST thresholds. I removed the primary key `id` because it was annoying > to take 20 minutes to insert the data in the large scale test. > Unfortunately, you have not included the new script, so we can't try > reproducing your results. > Let me try to find something not so insane. 128kB shared buffers is a little bit ... insane. I refuse to optimize > anything for this value, and I don't even call about regressions. Even > 128MB is not really practical, any serious system caring about > performance will use tens or hundreds of GBs of shared buffers. > I am not going to dispute that > If the tests I am doing are pointless, should we consider having > > something in the planner to prevent these scans from using prefetch? > > > > How would you do that? Please explain. > I have no idea. But based on what you said I thought you would know. In my head: "If my test seemed ridiculous to them all, they have some clear boundaries in their mind that they could write in the planner". > ... or you could modify the script to simply use sudo. > In that case sudo would request a password to the caller, and the caller is a python script, no interaction there, of course I could do all the steps manually, but it is more error prone (just my own mistakes are enough). Regards, Alexandre --000000000000ec79d0064aee3098 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

=

=C2=A0
How did you do that? Did you increase the number of rows, make= the rows
wider (by increasing the 'repeat' parameter in the script), or some= thing
else? Did you verify the table really is 1000x larger?
=C2=A0
I increased the number of rows by 1000. I didn't real= ly check the size of the table, the time increase suggests=C2=A0that it was= right.
=C2=A0
The "10k table row" means repeat('x',10000) when generati= ng data? Oh, I
see you're using some string_agg(), to make it not compress. But note that if it's TOASTed, it become entirely irrelevant for the prefetching=
test because it's in a separate relation.
=C2=A0
sorry, 10k row table, for the payload I left a note

<= div>> [b]=C2=A0This time I used a (SELECT string_agg((i*j)::text, '+= ') FROM
> generate_series(1, 50)) instead of repeat('x', = 100), just to prevent it
> from compressing to nothing when I try lar= ger payloads, and hit the
> TOAST thresholds. I removed the primary k= ey `id` because it was annoying
> to take 20 minutes to insert the da= ta in the large scale test.
=C2=A0
Unfortunately, you have not included the new script, so we can't try reproducing your results.

=C2=A0Let me = try to find something not so insane.

128kB shared buffers is a little bit ... insane. I refuse to optimize
anything for this value, and I don't even call about regressions. Even<= br> 128MB is not really practical, any serious system caring about
performance will use tens or hundreds of GBs of shared buffers.
=C2=A0
I am not going to dispute that=C2=A0

> If the tests I am=C2=A0doing are pointless, should=C2=A0we consider ha= ving
> something in the planner to prevent these scans from using prefetch? >

How would you do that? Please explain.

= I have no idea. But based on what you said I thought you would know. In my = head: "If my test seemed ridiculous to them all, they have some clear = boundaries in their mind that they could write in the planner".
<= div>=C2=A0
... or you could modify the script to simply use sudo.
In that case sudo would request a password to the caller, and the caller i= s a python script, no interaction there, of course I could do all the steps= manually, but it is more error prone (just my own mistakes are enough).
=C2=A0

Regards,
Alexandre
<= /div>
--000000000000ec79d0064aee3098--