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 1uzCvY-000kC0-Hx for pgsql-performance@arkaria.postgresql.org; Thu, 18 Sep 2025 11:35:52 +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 1uzCvX-00Fj3F-3W for pgsql-performance@arkaria.postgresql.org; Thu, 18 Sep 2025 11:35:51 +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 1uzCvW-00Fj37-Q8 for pgsql-performance@lists.postgresql.org; Thu, 18 Sep 2025 11:35:50 +0000 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uzCvT-001Uwh-0T for pgsql-performance@lists.postgresql.org; Thu, 18 Sep 2025 11:35:50 +0000 Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-5688ac2f39dso1080673e87.3 for ; Thu, 18 Sep 2025 04:35:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1758195346; x=1758800146; 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=PL3WfVDHMj9tLxk/fP++tBsN+2ErN9Exe5+rGg75it0=; b=UzkD8+RBp9F3ZPucbxtCzAJFkJBJgzvjsRTbwxuQSXzA8Vn4axLHtPMY6pq7akNK9C 1ND3yB99AqxvkxeulhVWugKRIDTgids+oXN7pNYdsqU9sbtFJffqc+d2qXr4CKopl6CN nylc3+XyfaBSxjPlK7oQOXYXZ455TH11o7wKMWz+8QWq9rgxDtjjtilYxJ+Er6uLmd1y lAQ83uwolbrdWbLnbaQQLgATF6sZXb3W5oBF/hDT6MUGvBKTbQmNE6jzV2d75mKMwJRq rJNxGtfHumNJFrjMETH8TY6WrdzUJ7cQ6lmUzOObvdLqjC9hPKFNfKLAEcPFMkZfhV8D MBwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758195346; x=1758800146; h=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=PL3WfVDHMj9tLxk/fP++tBsN+2ErN9Exe5+rGg75it0=; b=lLnAybL0HqIpAc8oA4xdjywIp97Zj9p6Umg1P6ScwOzXEX2wKxxTbuHklvpNIPhIHG o73bGiG8lvqCZnd+X/68KD9R1Cl1HlxkmMrSoFjSiL3Fiwf+Xeyunot4QQl+AHh22jX1 uJwsNbbDAYuZa6dLUbBX/OwpfAXsYGPI6jP7LgZ9JOd4fDdhp5k/TfpGxUvPyjqZwns3 9J66yB6xN54vFSZqMQ5IiEPdQ7WoYCnPeLyIyA9xCpEBXSB3rtLseGX04wzzHTKOc6Vq 6q1ObQAoJ2Uyf6+ScywLw4zdc94c416bKLsN6yFQdOs3x/ByOaGUP9NG2O+/lbk48XeG Vsow== X-Forwarded-Encrypted: i=1; AJvYcCX0ZJKYD53qS9lYRKTY/IRpxeBIY/OwSAa4bLT+n72KpoLCCyR9Xp8GiA37UNnLLQVEwDV/VZoj1hWnkiEvUf5jnw==@lists.postgresql.org X-Gm-Message-State: AOJu0YzZGT4wultMIvOgqrFEBSa/28qfNnI9GpKNIdrXutejkbQk3gfs cDHJbnyUaTYz1fv0gf1ybSPDRE83seMfXbNKIgtC8GezJLaCeOWk+NsBKutOZbINx7Qbaso+8FE 4eItWP1LqS8CA+tX6+sC2P7Dh6crGwGfAiw== X-Gm-Gg: ASbGncthRHcCzOydIct0Rz7as59FCI5dQ3bkvCvD3xrfgnP8L8/rOVDAKj/atwPFR64 qpVWgnpYgfiWmxU8N/iEWQbiSphXr13ih4sEacFN79s6appNifoDiHfOCu+r/N2U//raTfq5ZRe 5mKh+YF+MWupHEyDWjxiX7ec2VDetOmKLLKOGynYRE9dILPTcAfviQ1QLi/hkd1fVCmud4sMMUR XTihEYEKoHC54CD7ZNnotKJpxy8bu1oXaAechPBAWEO7ClFrNB7cbX0T4LH X-Google-Smtp-Source: AGHT+IHT3Td0TO4XF3x4MsWSOtVZFxlyNAbFykxl5ea7JP7jAwo2JUhRfCiM4g9M8R+Wsxbe6PKGQSHExPB4iTEHPuo= X-Received: by 2002:a05:651c:2554:20b0:336:b941:4ab1 with SMTP id 38308e7fff4ca-35f614dd7c5mr13641711fa.17.1758195345979; Thu, 18 Sep 2025 04:35:45 -0700 (PDT) MIME-Version: 1.0 References: <8f25c08c-acb2-47ca-b8c1-6664fc31a361@thefreecat.org> <32dc1fe9-175a-4894-b4c4-c6cdc6a76a16@gmail.com> In-Reply-To: <32dc1fe9-175a-4894-b4c4-c6cdc6a76a16@gmail.com> From: David Rowley Date: Thu, 18 Sep 2025 23:35:34 +1200 X-Gm-Features: AS18NWB5B7RlVSU8Suv64XBdjEeBKwFbUQIkHBBb6bBPsLMxFxUB7Rzv9FgB8_E Message-ID: Subject: Re: Why isn't PG using an index-only scan? To: Andrei Lepikhov Cc: Jean-Christophe BOGGIO , "pgsql-performance@lists.postgresql.org" Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 18 Sept 2025 at 19:55, Andrei Lepikhov wrote: > Imagine if we had a hook within the ExecProcNode. In that scenario, we > could create a trivial extension that would stop the query after, let's > say, 10 minutes of execution and display the current state. This would > give us more reliable data on estimation and the state of the plan tree. I recall something along those lines existing once in the extension world. Or maybe just from a previous employer. I don't recall many of the details. Maybe something like a function you pass an SQL string and if you cancelled the query it reported the EXPLAIN ANALYZE done so far. I assume it must have done something like LOG it as it couldn't have shown the EXPLAIN as query results on cancel. David