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 1tzJH3-000crx-Ih for pgsql-hackers@arkaria.postgresql.org; Mon, 31 Mar 2025 17:50:13 +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 1tzJH1-009fVZ-HP for pgsql-hackers@arkaria.postgresql.org; Mon, 31 Mar 2025 17:50:11 +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 1tzJH1-009fUZ-7M for pgsql-hackers@lists.postgresql.org; Mon, 31 Mar 2025 17:50:11 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tzJGy-002GtB-39 for pgsql-hackers@lists.postgresql.org; Mon, 31 Mar 2025 17:50:10 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 52VHntMn4118245; Mon, 31 Mar 2025 13:49:55 -0400 From: Tom Lane To: Robert Haas cc: Ilia Evdokimov , Matthias van de Meent , Andrei Lepikhov , pgsql-hackers@lists.postgresql.org, Guillaume Lelarge , Matheus Alcantara , Alena Rybakina Subject: Re: explain analyze rows=%.0f In-reply-to: References: <3737950.1740182671@sss.pgh.pa.us> <3816053.1740190267@sss.pgh.pa.us> <40663fc5-edac-4b45-a2aa-a76976700ed9@tantorlabs.com> <432c75b0-be5f-4836-b46b-98c505eaad28@postgrespro.ru> Comments: In-reply-to Robert Haas message dated "Mon, 31 Mar 2025 13:35:49 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4118243.1743443395.1@sss.pgh.pa.us> Date: Mon, 31 Mar 2025 13:49:55 -0400 Message-ID: <4118244.1743443395@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Robert Haas writes: > But why isn't it just as valuable to have two decimal places for the > estimate? I theorize that the cases that are really a problem here are > those where the row count estimate is between 0 and 1 per row, and > rounding to an integer loses all precision. Currently, the planner rounds *all* rowcount estimates to integers (cf. clamp_row_est()). Maybe it'd be appropriate to rethink that, but it's not just a matter of changing EXPLAIN's print format. regards, tom lane