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 1uAZJJ-00GsGX-LW for pgsql-hackers@arkaria.postgresql.org; Thu, 01 May 2025 19:11:06 +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 1uAZJH-004Yr4-Gw for pgsql-hackers@arkaria.postgresql.org; Thu, 01 May 2025 19:11:04 +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 1uAZJH-004Yqv-6l for pgsql-hackers@lists.postgresql.org; Thu, 01 May 2025 19:11:04 +0000 Received: from forward501d.mail.yandex.net ([178.154.239.209]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uAZJF-000aKW-24 for pgsql-hackers@lists.postgresql.org; Thu, 01 May 2025 19:11:03 +0000 Received: from mail-nwsmtp-smtp-production-main-95.iva.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-95.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:3b21:0:640:4c47:0]) by forward501d.mail.yandex.net (Yandex) with ESMTPS id ACEA861092; Thu, 1 May 2025 22:10:59 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-95.iva.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id uAdpfdaLma60-Jywwf1H5; Thu, 01 May 2025 22:10:58 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tantorlabs.com; s=mail; t=1746126659; bh=YMtUY0soamYR2uic3yvDSz96Uzct2jK+VpE7DG3qf3I=; h=From:In-Reply-To:Cc:Date:References:To:Subject:Message-ID; b=XhASM+U4tWb1mUW+OFkSwkkrAsRm+hK+prUxeJSYEyjhDFgh6N0si+mme4S70N0NV hl0amVzFu81VvJkO7S8inAJ4tUNT7KcPjMu8B8Vm5cCmwh4hLjheW0saiC2pFhlvFF O3iyi9ttcEfLmqP8MIvCnimGjyYfvtuBqLYXPC3o= Authentication-Results: mail-nwsmtp-smtp-production-main-95.iva.yp-c.yandex.net; dkim=pass header.i=@tantorlabs.com Message-ID: <14a42b49-f733-41ba-9cde-8669984116e6@tantorlabs.com> Date: Thu, 1 May 2025 22:10: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: Andrei Lepikhov , David Rowley Cc: Robert Haas , Tom Lane , Lukas Fittl , Daniel Gustafsson , PostgreSQL Hackers , Nikolay Samokhvalov References: <81ef0f5a-b6a1-4417-ae3a-2bae9b8d419e@gmail.com> <67b5c84a-dedd-4103-af7e-0117046102fe@tantorlabs.com> <580fe72c-85be-45a8-9e00-6b5417690557@tantorlabs.com> <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> <8e9f46ce-e087-4dd5-b0c2-4459170da11f@gmail.com> Content-Language: en-US From: Ilia Evdokimov In-Reply-To: <8e9f46ce-e087-4dd5-b0c2-4459170da11f@gmail.com> 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 01.05.2025 16:37, Andrei Lepikhov wrote: > I still think that two meaningful digits are enough for an EXPLAIN. We > usually need to estimate the tuple set's size, not a precise number of > tuples or groups. And definitely, not an arbitrarily chosen two digits > after the point. So, IMO, good examples may look like the following: > 50%, 5.0%, 0.00051%. > The idea is not bad. But I think it might be better to raise this in a new thread, because this is not the only place [0] where we might want to output numbers like that. We could also discuss there what else might benefit from such formatting. [0]: https://www.postgresql.org/message-id/3365160.1739385615%40sss.pgh.pa.us -- Best regards, Ilia Evdokimov, Tantor Labs LLC.