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 1tmegR-008Tue-69 for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Feb 2025 20:04:07 +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 1tmegQ-007aXs-Ee for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Feb 2025 20:04:06 +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 1tmegQ-007aXk-5F for pgsql-hackers@lists.postgresql.org; Mon, 24 Feb 2025 20:04:06 +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 1tmegN-000az6-2F for pgsql-hackers@lists.postgresql.org; Mon, 24 Feb 2025 20:04:05 +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 51OK3wut1471694; Mon, 24 Feb 2025 15:03:58 -0500 From: Tom Lane To: Jeff Davis cc: Corey Huinker , Andres Freund , Michael Paquier , jian he , Nathan Bossart , Bruce Momjian , Matthias van de Meent , Magnus Hagander , Stephen Frost , Ashutosh Bapat , Peter Smith , PostgreSQL Hackers , alvherre@alvh.no-ip.org Subject: Re: Statistics Import and Export In-reply-to: References: <3670503.1740173078@sss.pgh.pa.us> <3728741.1740178078@sss.pgh.pa.us> <97b451228227c555be1a4f79c4a62ddec9a74f06.camel@j-davis.com> Comments: In-reply-to Jeff Davis message dated "Mon, 24 Feb 2025 11:45:51 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1471692.1740427438.1@sss.pgh.pa.us> Date: Mon, 24 Feb 2025 15:03:58 -0500 Message-ID: <1471693.1740427438@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Jeff Davis writes: > But you have a point in that float4in() does slightly more work than > strtof() to handle platform differences about NaN/Inf. I'm not sure how > much to weigh that concern, but I agree that there is non-zero > cognitive overhead here. If we're speaking strictly about the reltuples value, I'm not hugely concerned about that. reltuples should never be NaN or Inf. There is a nonzero chance that it will round off to a fractionally different value if we pass it through strtof/sprintf on the pg_dump side, but nobody is really going to care about that. (Maybe our own pg_dump test script would, thanks to its not-too-bright dump comparison logic. But that script is never going to see reltuples values that are big enough to be inexact in a float4.) I do buy the better-preserve-it-exactly argument for other sorts of statistics, where we don't have such a good sense of what might matter. regards, tom lane