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 1uzVtI-004NPz-KY for pgsql-performance@arkaria.postgresql.org; Fri, 19 Sep 2025 07:50:48 +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 1uzVtH-005BNV-Aq for pgsql-performance@arkaria.postgresql.org; Fri, 19 Sep 2025 07:50:47 +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 1uzVtH-005BN1-0G for pgsql-performance@lists.postgresql.org; Fri, 19 Sep 2025 07:50:47 +0000 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uzVtD-001f4w-0d for pgsql-performance@lists.postgresql.org; Fri, 19 Sep 2025 07:50:46 +0000 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-45dde353b47so9028265e9.3 for ; Fri, 19 Sep 2025 00:50:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1758268243; x=1758873043; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=g1ntefZkzG09j/nlkwQOkRKiGFm2UtYT4sEWuq6QCoA=; b=BLRCpTfIYdZOC5Db+jEZravx4vE+v15tYFZJN2zhBVoQYNZGjzQBe00orAu6pLuLl4 wR0C3tvGZFfBXrmaLnoBrLuAb74I3rbGPmMyHyZOp5oDiymuYj9mYfVJ0EKJNvxBsCYr uYrgvrznLrr35TBXmW0S0o582cI9khUbw0L5B5B+JcXbp1GNL/ILRg64Jykn1R9Pfz8I d0YtOuNHZT2YJT/J5GzwwCB7vxz6x7IBoCQE+RRJH7jeo8JX7IFm1Cj3Ye22mTOwHLlI 5E/K83sQkeckA7EpwMltQu3XrshU4GOLKLDZYlKKaqlNpPlfTGJG5/5ZGfaf7wAY/Zil srQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758268243; x=1758873043; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=g1ntefZkzG09j/nlkwQOkRKiGFm2UtYT4sEWuq6QCoA=; b=Dp0k4CBpSIhTZXvVPvUVQ1Jnx11JC/xDCk9iHW7d1ezeSFQpvipZRhPp5EIS42/gTv YcYo6RW2gIeW/AMSMi85MDwMYxYq3jB1R+lkPc1qeHQRGQRrTzTiKen25m6mMiHQ+BBZ VrycZZXUDbHRIq9axQOKyNC8SzEkzBC1r5XA8lVj5ARLQeALV3kt3PNg7/dm7HLQNWt9 dp9G3IaiftKRQjXdw4iOSMRaowukVkOnIEUevu+DWurPCFZLX3/afMSKW0PtIksoazIY p/aPth6/kiJueJp/MYR/Rqn+JgeRLO4MMlRpAMyh7aawdQBVuicJD4LiBM8rVrcFr9Ny 5xjA== X-Forwarded-Encrypted: i=1; AJvYcCWg6eL1vQWIFOfNP6kL8yUqRejQMWGRYcu4VkLDGd71vrAweKdxKvvWuQUWnQCMqDHxbguEb0FidEgQiGekKaNWHw==@lists.postgresql.org X-Gm-Message-State: AOJu0Yx5YgiBRq8i74JrggivoMKN4N3i/IYEJkHFJf84msq3TNHyifEZ 6IrffI60E/nPVXUGVpx5iihhAAK4tYkvg0e7ER4ipRBVE8xvQOiPpcHO X-Gm-Gg: ASbGncs4XWKGUIsEGPEEEvmEr1CAsWLD+IMcv0Q2ELGOqygJ2NkQPAwWRtURndMgWrR zYq1LxTTq2aDLjFBR7bm4RwSrT+PM4egzxhweMYn3+PKjjxgr7DBEFHZFUat8eF4JVbyUTGzxdv ESL//ONJPW5LqVFjSsBiEHr95YWMw6zS7ecvmM1EUbwzcJK4c5NvU68y+2dvU+j/TCQj2qtPZA+ 8JrbuDmaIxOagK5HfwZGrzuT/3mXojfjfFMLQ6rnfhCi/B7uPUdQOyD6zcAskP//NoGUt75f/cd 2tlJyhX1WGBI7pTUCtmzXKRHWIFVUSLUPF8tpSDYw8CvbU/hjrHAH0ITcGUy9ee1Xd0AHX8lNZF rZD637iXjhOLWYaEoY9RnWcrAGewNw1JsSpTXqsI8SQk0 X-Google-Smtp-Source: AGHT+IGgrU5DAXqNEZIwqsHBZkxfLlbwLx1ip9meIxA2j9Ojf6QKa8BP+cAuvHc1qRg9txUXlHMFqw== X-Received: by 2002:a05:600c:45cc:b0:45d:f897:fbe1 with SMTP id 5b1f17b1804b1-467f2eb1d80mr13638605e9.32.1758268243019; Fri, 19 Sep 2025 00:50:43 -0700 (PDT) Received: from [192.168.15.124] ([80.251.191.198]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-46566f72354sm67539035e9.3.2025.09.19.00.50.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 19 Sep 2025 00:50:42 -0700 (PDT) Message-ID: <32bb39c7-7c52-412d-9ea8-fa1376b758db@gmail.com> Date: Fri, 19 Sep 2025 09:50:41 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Why isn't PG using an index-only scan? To: David Rowley Cc: Jean-Christophe BOGGIO , "pgsql-performance@lists.postgresql.org" References: <8f25c08c-acb2-47ca-b8c1-6664fc31a361@thefreecat.org> <32dc1fe9-175a-4894-b4c4-c6cdc6a76a16@gmail.com> Content-Language: en-US From: Andrei Lepikhov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 19/9/2025 03:05, David Rowley wrote: > On Thu, 18 Sept 2025 at 23:55, Andrei Lepikhov wrote: >> Perhaps we should start working on introducing this type of callback/ hook? > There's certainly places where you could add a hook that would just > add an unacceptable overhead that we couldn't stomach. I expect > ExecProcNode would be one of those places. That seems a bit odd. It is not a significant issue to instruct the compiler to trust the 'else' branch of the "if (PlanState::hook != NULL)" condition and reduce overhead to zero. However, if the hook is set, it indicates that the user (module or extension) genuinely needs it to be called for this specific node. > I do agree that trying to come up with something for this is worthy of > some time and effort. Helping people with performance issues when they > can't even get EXPLAIN ANALYZE to finish is quite tricky.That's all I need; thank you. Starting a PostgreSQL project without positive feedback from a committer usually results in wasted time, unless you are purely conducting research ;). -- regards, Andrei Lepikhov