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.94.2) (envelope-from ) id 1ra9Ph-008JS0-7m for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Feb 2024 07:10:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1ra9Pe-004QYW-Tz for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Feb 2024 07:10:34 +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.94.2) (envelope-from ) id 1ra9Pe-004QYO-KS for pgsql-hackers@lists.postgresql.org; Wed, 14 Feb 2024 07:10:34 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1ra9PZ-00777B-VI for pgsql-hackers@lists.postgresql.org; Wed, 14 Feb 2024 07:10:33 +0000 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a26f73732c5so726947066b.3 for ; Tue, 13 Feb 2024 23:10:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707894627; x=1708499427; 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=ReCg+SUTHzkMesLDalrNOdhy+Y/5ZDtZjrW9XBhlU5k=; b=hlorPSWwiWtW3A6mIj6fJumQO+wbYuAzZFB9rET+O5MQrguaiD/hDrbQCY49gXWSnT kdZhxtTlIbXGv9HWsVPqxquOTlWUnjK+wk7u3pNqkJLjKxKZ8shNSCuQ3ahkaTjly3RS WiMeB17cO+lpleu+WVlMaGheRiXtQNqrUqj+tVLYiqB7oBjc1cZPWyUPrRwY+xfEckf7 C5+0ahWALvwLcG4ydGs0r1y5bifms6FAda1NGKzOR9sCCWVnXGMjKWp5HR0pAyGxZvN7 MpMsiCQaZchrjOEKnDuOM+q0DNft7y5IB3liKlNKy44tVDjdIBmOtzdv+3Z7Yylo400Y 2mKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707894627; x=1708499427; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ReCg+SUTHzkMesLDalrNOdhy+Y/5ZDtZjrW9XBhlU5k=; b=JNHcM2pd3ru7EyjtS+wvyFJn5ZSpsGDrjYl4TgMHpvNyqg+0Ogz64QWDtMku57q4p3 66vpCZ6HsenN/N6h6Auqvy7bbqXVE1B7ZUtcf1fRiBDMH4JYcP+qfS/auNex85Y122YZ dl7DLrNlrp2ZNKngZlaSX8q+Ml48vL3jPUASbJxQq5jSe4Sd/+3NK3/YOJxWSLA26QGi fZ5DXf7RSo7FLIlcDOTlpvcXCH2caOM7wZPCCbKKDfWI30P1CK2MuGWA6gFXfSJzzaPr tKsP6i1/FWCsN2cs7YPgb8MzRkH81YKYXt2qgKCjIO/gqSxD6HRd3+ToTML3fLUiwCRl gDXQ== X-Forwarded-Encrypted: i=1; AJvYcCVBuHxtavByrpmdSE1CQojDGYiA5d+g0Cyt08EQfZSIznRD86bcZ0KEXcPyvDMRRQm6ibLw9iCLF43zfkM+DeY7Qu47CUJP18hKcp4m6/Hxduwj X-Gm-Message-State: AOJu0YzRiYtlJAijTe8U0IS9FIh6NXvND9+10d4eHOwuV1ezsUdPAsn4 9vlPyaP/wWQvXUuTd9wH6Fxyt0uUKbeF7XistCu5PU9nT9xj+6jeqz/Fb11R5kHRpgHUO4cP4Hj qJ2SFWyNy2VuhgTeUBYXgzk0Lqc4= X-Google-Smtp-Source: AGHT+IHQAd17iiFiYwxchVkj8s04Sv9JNz00IRtPmmUYVL7gDEamGgyvONkHSDzUoszP4sCif5E9gRYSFNqGelh2dSY= X-Received: by 2002:a17:906:5596:b0:a3c:eeef:2283 with SMTP id y22-20020a170906559600b00a3ceeef2283mr1031306ejp.43.1707894627440; Tue, 13 Feb 2024 23:10:27 -0800 (PST) MIME-Version: 1.0 References: <8ec36f51-b863-60e3-20e2-b9c981c5ce5e@enterprisedb.com> <367160ea-b1ed-4481-e804-bca509128878@enterprisedb.com> <280dc83c-a16f-4424-1319-95e7e3f798bd@enterprisedb.com> <98ba4b25-fae8-c1f4-1597-8093375a1986@enterprisedb.com> <20231221134314.wf2rs62d37u62j7t@alap3.anarazel.de> <20231221154352.ijtg6wloa3nowivh@alap3.anarazel.de> <482ec3ff-52ad-415d-96fd-f3832a894023@enterprisedb.com> <56176b8d-956c-487e-ab09-310db4581c07@enterprisedb.com> <4867452a-b853-4813-a6da-9bb06a336f8b@enterprisedb.com> In-Reply-To: From: Robert Haas Date: Wed, 14 Feb 2024 12:40:14 +0530 Message-ID: Subject: Re: index prefetching To: Melanie Plageman Cc: Tomas Vondra , Andres Freund , PostgreSQL Hackers , Georgios , Thomas Munro , 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 Thu, Feb 8, 2024 at 3:18=E2=80=AFAM Melanie Plageman wrote: > - kill prior tuple > > This optimization doesn't work with index prefetching with the current > design. Kill prior tuple relies on alternating between fetching a > single index tuple and visiting the heap. After visiting the heap we > can potentially kill the immediately preceding index tuple. Once we > fetch multiple index tuples, enqueue their TIDs, and later visit the > heap, the next index page we visit may not contain all of the index > tuples deemed killable by our visit to the heap. Is this maybe just a bookkeeping problem? A Boolean that says "you can kill the prior tuple" is well-suited if and only if the prior tuple is well-defined. But perhaps it could be replaced with something more sophisticated that tells you which tuples are eligible to be killed. --=20 Robert Haas EDB: http://www.enterprisedb.com