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 1ueXKV-00AreR-25 for pgsql-hackers@arkaria.postgresql.org; Wed, 23 Jul 2025 11:08:12 +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 1ueXKT-001kuA-0t for pgsql-hackers@arkaria.postgresql.org; Wed, 23 Jul 2025 11:08:09 +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.94.2) (envelope-from ) id 1ueXKS-001ku2-IP for pgsql-hackers@lists.postgresql.org; Wed, 23 Jul 2025 11:08:09 +0000 Received: from forward501a.mail.yandex.net ([178.154.239.81]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1ueXKO-000NLN-22 for pgsql-hackers@lists.postgresql.org; Wed, 23 Jul 2025 11:08:07 +0000 Received: from mail-nwsmtp-smtp-production-main-60.vla.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-60.vla.yp-c.yandex.net [IPv6:2a02:6b8:c1f:1f21:0:640:a2e6:0]) by forward501a.mail.yandex.net (Yandex) with ESMTPS id 37B6A81229; Wed, 23 Jul 2025 14:08:01 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-60.vla.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id v7RS1R1MtqM0-R8Rddqd0; Wed, 23 Jul 2025 14:08:00 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tantorlabs.com; s=mail; t=1753268880; bh=V2qm7+qWCtNvMZFIDhKTKqVtSTQn8c8q5vYrM5cIeb0=; h=From:In-Reply-To:Cc:Date:References:To:Subject:Message-ID; b=p0ptm4EpOyIpV5PVc/BEbUqc3XIXl36ZSdBQdo5gaT3786nve9TTz3G/vMMI/9kCm yvReGtAMHQQBGmGBHq17N/mLX9F2GqX2YhU2EmzUQk1exFHw3qksqqcZq9MRhJRwzv F0uOTqgMk4T5Z2IP0jutIZfbqdPTdsgUBv5r1Bgk= Authentication-Results: mail-nwsmtp-smtp-production-main-60.vla.yp-c.yandex.net; dkim=pass header.i=@tantorlabs.com Message-ID: <3a4bff1b-f6d5-41d4-b956-2da25bed0aae@tantorlabs.com> Date: Wed, 23 Jul 2025 14:07:56 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Add estimated hit ratio to Memoize in EXPLAIN to explain cost adjustment To: David Rowley , Andrei Lepikhov Cc: Robert Haas , Tom Lane , Lukas Fittl , Daniel Gustafsson , PostgreSQL Hackers , Nikolay Samokhvalov References: <3ea66a50-e4b0-4f20-ae0c-4d9cbaf81cfb@tantorlabs.com> <0e8dc4fa-3655-4e9f-9424-9b32a15e6acd@tantorlabs.com> <7e995158-157e-4ec6-a7c8-266c1a6f7b43@tantorlabs.com> <06840539-e321-4930-9f89-cfc783c5b80a@tantorlabs.com> <15e0422a-31ec-4e82-b0cf-0839f636b185@tantorlabs.com> <5c7034c4-c48b-428b-ab3f-67f14d9f542e@tantorlabs.com> <34407b2d-946b-40cd-a665-49ca6af62fb9@gmail.com> Content-Language: en-US From: Ilia Evdokimov 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 23.07.2025 03:11, David Rowley wrote: > On Wed, 23 Jul 2025 at 02:35, Andrei Lepikhov wrote: >> The 'Buffers:' way looks more natural to me. I don't like duplicated >> text in the explain format - it is already cluttered by multiple >> unnecessary elements that distract attention from the problematic plan >> elements, such as unplaggable costs output if we only need row >> predictions, '.00' in estimations, etc. > Seems logical. +1 > >> Will you add the ExplainOpenGroup call to the final version of the patch? > I'm leaning towards not doing that as a reader might expect all the > "Estimates" to be within that group, but the estimated cost and row > counts won't be in there. Maybe it's possible to circumvent that > expectation by naming the group something like "MemoizeEstimates", but > IMO, that seems excessive for 4 properties. I agree. I would consider adding a group if we displayed information in a looped format, like for Workers, or if we had some particularly useful data for parsers - for example, timings or memory usage. But for four estimates, grouping seems unnesseray. Given that, patch v11 still looks like the most appropriate version to me. -- Best regards, Ilia Evdokimov, Tantor Labs LLC.