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 1tiHKZ-00DrF6-OA for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Feb 2025 18:19:27 +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 1tiHKX-00C2kv-Db for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Feb 2025 18:19:26 +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 1tiHKX-00C2kB-3W for pgsql-hackers@lists.postgresql.org; Wed, 12 Feb 2025 18:19:25 +0000 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tiHKV-000Tzv-1X for pgsql-hackers@lists.postgresql.org; Wed, 12 Feb 2025 18:19:25 +0000 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-aaedd529ba1so9934866b.1 for ; Wed, 12 Feb 2025 10:19:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739384362; x=1739989162; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=akxcHpS47YNCvMNtqCRAMBs2bplAfnrooHEyHyDou14=; b=fwWyo5ohzBLIzdv2OoyIY4FK7XBlFCy+KCsNKMgHPkV0MyZeXWc6NkJlyd7groBdLt bV2gG2VNTpm2Ay2ge88wmWteIEt/lyRc6ZqG8+7+B6v4iD6cKahiMgxu6Tl+bdbJCfs5 nuDuo0C+Wxmt+6Je2FNS2Mmjw8xnc742L9/QPBmV3IS54mbcEbqfDzjt2gfKk9ABgCCE BeBea8zq0UI7+k7+aMsJo3/TIrJDTRQ2GFdUXJ3QB8RvRPutyspz4PSanbMLCknd6IcQ A5VGCAAqau1v2M2wGV3s1e+1Td25i9Ml3hpv2PzzJfxB8WUG1B/P/sTUJGPXc3dm5jEB tW2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739384362; x=1739989162; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=akxcHpS47YNCvMNtqCRAMBs2bplAfnrooHEyHyDou14=; b=oHhzGDz+WliIycWK7WDvEDMRJ7fSus0zzL4pIfsC3GxEesF5iGIrHzm2Qa8z7LNHz+ +XamUAEmGb2nI1G7MH9QewyqOuZcXqMOTdBkGpxpZVZo1FrwKEL16GWZG0sNsWgCnYJX DroXZcKzDNO1yS0jPrFiKA7ueUFj8BdDTOjtBwKu+jdgFp0mJrpq4Q/Vy740wKv1xkFI NhK7IEkZZnNObBvvxXCWYmI2SmV3oglozzmvSAwKwzbs3w3EF13hT9oOURxQITE+nuJn OgGYWgz/qwFagnaGqIRC5Pit2zT5TPIM6vFnpHqhutRM2wihqdYzbl6YQ9+G8pRQSHTL WVfQ== X-Forwarded-Encrypted: i=1; AJvYcCXDpd+qWK4ghkV4TXztSCBnYi32WVMfl9teL8quvfHsC/GNwvYnDVZN6ykrFPCfQC3XNUG5eJxxP4EXMoi+@lists.postgresql.org X-Gm-Message-State: AOJu0YyrNB/VjirkUJbnkKQVIuFWXWTWqBR/caXp1WdNAkxQZWwT3P+4 25ZLhSdqOdq6NvgeMvzXELwdh2tEOrx5qzL+KX+DzKfy3TiVjLexWJS4Qlwum4dBbn5rHkOAfNM 9IMfhfgi33Ofsz7ppuzSiAJGtAFE= X-Gm-Gg: ASbGncv21r0BWyLEbJllUtFEbWGYANiwDhqBFXYR+TEffup3BjqT159Sf1G+NATlSi0 ZfDjNhNHBPEnco8YFborvfZwSg4zp7XTAYfXeajh1ltposOadH+/sZ2gK8EC9fuESsxA4hIwl X-Google-Smtp-Source: AGHT+IEJ24zPIxu+sH4ungiq/puwGEELMWFDUfWO/cmaVE4PnqOQ9WqiKGHtjPZu1ChRdxpq94CEj4YA0lRzI8wYsX0= X-Received: by 2002:a05:6402:194b:b0:5de:b947:b22a with SMTP id 4fb4d7f45d1cf-5dec9d393e8mr398894a12.11.1739384362430; Wed, 12 Feb 2025 10:19:22 -0800 (PST) MIME-Version: 1.0 References: <55695d15-c738-4401-8883-58bc855c9b03@tantorlabs.com> <58bb3a5b-c92a-408c-b02a-f47aedc1c0e2@tantorlabs.com> <70bc1af0-6910-4f71-84ba-fa02095fe9ba@tantorlabs.com> <3212947.1739306803@sss.pgh.pa.us> In-Reply-To: From: Robert Haas Date: Wed, 12 Feb 2025 13:19:11 -0500 X-Gm-Features: AWEUYZlOBHZhzWOOqQyR7STdQn-92Snsmq6rnFrXeg-eqn-cC5eE5nr1xVeQj3A Message-ID: Subject: Re: explain analyze rows=%.0f To: Ilia Evdokimov Cc: Andrei Lepikhov , Tom Lane , Matheus Alcantara , Guillaume Lelarge , Daniel Gustafsson , Ibrar Ahmed , "Gregory Stark (as CFM)" , Amit Kapila , Justin Pryzby , Peter Geoghegan , vignesh C , "David G. Johnston" , pgsql-hackers@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Feb 12, 2025 at 5:10=E2=80=AFAM Ilia Evdokimov wrote: > I think the idea of keeping two significant digits after the decimal > point is quite reasonable. The thing is, rows=3D0.000001 or something > similar can only occur when loops is quite large. If we show the order > of magnitude in rows, it will be easier for the user to estimate the > order of total rows. For example, if we see this: > > rows=3D0.000056 loops=3D4718040 > > the user can quickler approximate the order of total rows for analyzing > the upper levels of the query. I agree that showing 2 digits after the decimal point in all cases is not ideal, but I suggest that we take a practical approach. Figuring out dynamically what number of decimal digits to display in each case sounds complicated and we may spend a bunch of time arguing about the details of that and get nothing committed. If we just show 2 digits after the decimal point, it will not be perfect, but it will be 10^2 times better than what we have now. If I'm honest, what I actually think we should do is stop dividing values by nloops before printing them out. Every time I'm looking at a quantity that has been divided by nloops, the very first thing I do is try to figure out what the original value was. The whole reason I want to display at least a couple of decimal digits here is so that I can do that more accurately, but of course the dream would be not having to reverse engineer it like that at all. However, I expect fierce opposition to that idea, and no matter how misguided I may think that opposition might be, a patch in the tree is worth two in the CommitFest. --=20 Robert Haas EDB: http://www.enterprisedb.com