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 1vuF86-009ZXx-0x for pgsql-hackers@arkaria.postgresql.org; Sun, 22 Feb 2026 19:28:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vuF84-00BOVo-1P for pgsql-hackers@arkaria.postgresql.org; Sun, 22 Feb 2026 19:28:32 +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 1vuF84-00BOVf-04 for pgsql-hackers@lists.postgresql.org; Sun, 22 Feb 2026 19:28:32 +0000 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vuF80-00000000kXK-1poZ for pgsql-hackers@lists.postgresql.org; Sun, 22 Feb 2026 19:28:31 +0000 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-48373a4bca3so21849905e9.0 for ; Sun, 22 Feb 2026 11:28:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1771788506; cv=none; d=google.com; s=arc-20240605; b=Zg9aKz1ylhrRdPrsZLQdS/y7baXjWQK9hX6bvXcDcz6rnvYZUMYGgS9NLHlJEU3jrP RukzRF/dA43Fq/CGRXBamPdkJaHdC9ObKmr7FXLa+JSgOSBVO0EJT21REkIb0DSczbqE I+7rEcqcL+QD4Rvk70YOTF+e1iSKPLG5eeuJ5+ODhhrgPqIetid8u9FP6JK1uwbSx2kS Ih7AwX+QN9R9S7GKf5bTlQL2chVbFNvch+7ilQp090cclOPKg+MdWJgjfxHB0uNK6NER yREgghFXYwbB7ehaqQeYbN6+uaOjQoBmHp/DUd2IE1jmM88F81Q8hHMoLxRz+xzQG8rF dOjQ== 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=xYi4pE5OcHftWx+IWUuwHCAO4eWOgvuIjLGZfp2uFhY=; fh=c4uUdA4fgplxpMF9kaAKOAzjpmxt1A+88zpYsZP5y70=; b=aK4TYmsSyZ9AUujDGUIGB6gyDohiVflx2P32d82ga3vLwlWuNdMt9lAFfFmcd4eN2z a+D5i3KdCariyiuXdm7dEAi9M50uR4pfI8oavHWeST4TQlTrKts6k+SaL5z1zfatVgyB tKSyO7dP6+aZrUcstczCizalLvqQZfie1i3oGbEkWwqmjwvMXAn11hwOlpR/d7r4WHOK 5x0fX62530Gl7hEhMc9SJR8ZJjAFYqtvh0PhMiaV0xY7heupyTpe5H2S7MUGqaFjO0VQ yKlYgorKT55jSmiGEdHFInzLjmL9NnsJ/oiyuBERqrx4lUWNaZvLz+0OwbWHZRiMALHr P+lg==; 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=1771788506; x=1772393306; 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=xYi4pE5OcHftWx+IWUuwHCAO4eWOgvuIjLGZfp2uFhY=; b=u2lJf3jb/TmKmN8qp7TjgbcZWEM3gtsqYPAG0ySctc93bxALnGYwBzJsN9LVs4Y4yD BnpRg4+YCPpsNfB+rVgkeOoiKMxzIv6TopPceeFA3pWZp9/kjijeDe4ed4OZRKpmXb0D fVRjUPubKOY8/YzK7+RlWDuVNg8/8mEH9p2KrT2W5pE5+dIWiwz+t2vzXg9HrWXFD+X6 KCIXmbr0PIf5EUOa/VdQEeODj8KdWQrRa3azjFGgZw8S+w/YAwYOZhpufRAGdHmCDVJt f8QyIiwpDXs0y6rqAcjt16uRQx9MNzqbm6wscz0OUeRI0d+JA/kSPkmCFbtir3+nccnz o65g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771788506; x=1772393306; 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=xYi4pE5OcHftWx+IWUuwHCAO4eWOgvuIjLGZfp2uFhY=; b=EFMkodbphLIMYnp7gLb7GK4LXD61q/tAniMeHhp+yvwbaCTdtHbxTddHPGfZH9ro38 n/E3QMAi6+4wyAgi0pD/6k+3AO9F7Is8+MfkLSfm1PlOan8Q45TKhqvYsqyDnk41oRWC Tb1adnLaVM3hbi+FfjX1SJWxrwV4/G3kltTbXXmEkNquxabwurRqD+jEanf5d0t2Est+ MFn0CCvde6Z+p4h9gkXjis1cS7zRbKRmfERGaERuuulhS0WlPfRncOtqPPtdHsH8UW6G EapT1EY41TB05du55k5BcZH98kJM0Nc5KTN76mcanXQp3mJ07M/Pe8VPWYqpiZn0RZ+G x2UA== X-Forwarded-Encrypted: i=1; AJvYcCW+P9d072gXPkYwHDMl7hhqaT4uMhGGFqqY1vbWLnw2kHpds3m3QfEo7SnQS2uup1u/GR/EGK8uZaEbCmO8@lists.postgresql.org X-Gm-Message-State: AOJu0YyL5Ijus87AxriB/3V0F7hhIC9mi3ZoC1lQLlnVij2Us9SeCIlx 3y6LKdh4rH3UnNyGEGeAnbK7QVxXp2KhbqpgE96IEdtjrnPCgdgSqcWB2XFOVeWTBXJ+9pRR+bE mQqrBbyuverPDJKJnG29ULWsse8v4ojDX2BFPjqESxA== X-Gm-Gg: AZuq6aK/9CJ3r8giY7sSEmWHZr/tSA9QLs2Ujrs+H+7M19YXzPpzQIlnOiFZKMaw6Hw C7pj4PR/zWK1JMkCQ1TVmEAkW8rYF/CdaCcWVv+CqTuJAwFmrHWXuUdofr1hGoZe1zHFF/nigrk ZTK37j5gDQuntP+58xv7KJlv3I1AVjVlQJVqv078O8OaFNoidG+HiHmIA7LVNlHEJVeV624PAy7 BsOFgw2/llctpkM8mnwrNNJX9uY3TgEuCvOcpywcMcAziNKPbB57UnD8INMRg9wwYlmAKp5MeNw pJ9IBij+ATKk+yjNcg== X-Received: by 2002:a05:600c:8b01:b0:475:de14:db1e with SMTP id 5b1f17b1804b1-483a95f8ce9mr108848305e9.24.1771788506026; Sun, 22 Feb 2026 11:28:26 -0800 (PST) MIME-Version: 1.0 References: <64a2re223ajj4popowsyu4xekbuvvyfwkrihn5yzyrkwsmsuvp@2lls3tpww5dl> <52512325-b1f2-4fff-819e-f68122b2e427@vondra.me> <64mfcfv7iihc4pmqlxarii4esnmqry52ckz5m7lmwylnfnuxuz@oxh4ioxkjtep> <720560ca-97b9-40a1-ad40-9f9b8a6648e9@vondra.me> <2f7fdaa6-2855-4a49-884c-16b91db9a97b@vondra.me> In-Reply-To: From: Peter Geoghegan Date: Sun, 22 Feb 2026 14:28:00 -0500 X-Gm-Features: AaiRm53Oi4KK30L71buN8qBwXmqgh-plJPoGOhGOSsovo3IzhKl650JGEgVw098 Message-ID: Subject: Re: index prefetching To: Alexandre Felipe Cc: Tomas Vondra , Andres Freund , 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 Sun, Feb 22, 2026 at 11:23=E2=80=AFAM Alexandre Felipe wrote: > DISTANCE CONTROL > > I tested different strategies to increase distance. 2*d, 2*d+1, d+2, d+4,= and so on. In my head, what would make sense is d + io_combine_limi, but i= n the end the 2*d gives the best results across different patterns, e.g. (h= {200}m{200}) that seems to be a more reasonable pattern, as previous scans = would have loaded in blocks. But these are fundamentally the same, as I pos= ted about this a markov model, and the limit will be something like max_dis= tance * sigmoid(h * (p - p0)), what changes is the transient when we go in = and out of a cached region. I don't understand. Why, in general, would a Markov model be useful for determining prefetch distance? > LIMITING PREFETCH > > To avoid prefetch waste with a limit node wouldn't it make sense to send = from the executor an estimate of how many rows will be required. There's a patch that does that. Have you looked at the patch series at all? > I/O REORDERING > > I did an experiment reordering the heap accesses, following a zig-zag pat= tern There's no question that reordering heap accesses is an interesting direction to eventually take this infrastructure in. I've experimented with that myself. But this is the worst possible time to be increasing the scope of the patch for an uncertain benefit. We're in crunch mode right now, ahead of feature freeze, which is less than 6 weeks away. Tomas has been working on this project for about 3 years, and I've been working on it for about 1. Long digressions about the asymptotic complexity of priority queues add less than zero value. --=20 Peter Geoghegan