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 1tzKVx-000s2P-Sv for pgsql-hackers@arkaria.postgresql.org; Mon, 31 Mar 2025 19:09:41 +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 1tzKVw-00AqtA-5H for pgsql-hackers@arkaria.postgresql.org; Mon, 31 Mar 2025 19:09:40 +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 1tzKVv-00Aqt2-R9 for pgsql-hackers@lists.postgresql.org; Mon, 31 Mar 2025 19:09:39 +0000 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tzKVt-002C2n-2z for pgsql-hackers@lists.postgresql.org; Mon, 31 Mar 2025 19:09:38 +0000 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-ac25d2b2354so768486866b.1 for ; Mon, 31 Mar 2025 12:09:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743448176; x=1744052976; 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=8q0A80LnAuQA+fL4wvi2ObUMPWUlJLo5LQIMecZbu+Q=; b=UL+evgnPvs3GdTEPHkBmlpH3F2aLnMtsZ3qU4+zhTAvmEeprR4YVAgkhy67KXYEJ8R OWKV8E+VmTWQ2wfehB9p/BlOAkkLqufA0zbu+zqlfoN0HArPVMweNJjI0ljV1sym2R49 I7yMb7eimpCatRYW9M/pcrq30E9V7k2hzU1m+/PRfkCg62VZ42ZYT8Ad5c9HxgI4Oiue AHcRD2X4aEIKMUkJBR/luHqAziBiELcY/jtv0nkZSJi2w7mYJmmSE+tS80qn1yAacreJ 57OCQURASxzROGvfnRTyPb+BdU5nzB0ATvQbACMxVq2MuEJmp5U1uysvK8n3t5kUTJHV MuGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743448176; x=1744052976; 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=8q0A80LnAuQA+fL4wvi2ObUMPWUlJLo5LQIMecZbu+Q=; b=DUrZlLUvzifow0ok1XDmQWSWiIiVQgAWmDKiJrgp6RWzagNS6D49o7ZDNJGD+HSWOs c5Cn/b0uT0EAT1FOizqO3QRYgPeRpPYREc/d42jGrJ6v4KNKV2qpSBRcs40utNMJLqKa 5M7aZ/3c52ttl6jaA7nLEVidUKH23QPlakcdOvGKR5A3/26VDYbrtICWyJFBO32z/qCr o2JDK5Hqmcn3oW6ktzh2DAGBiPKPZ8CjRlkxWWUvUvpPzM8Y6Y/I4jPKhFTn6qpXcefF PtL8kv+U7D4gmFabrOYrlM7pbmGU593rcFXSCe31UiePRNmkRcgvm1ZBa0wF7IzROSC6 ICmw== X-Forwarded-Encrypted: i=1; AJvYcCW/ga/NZihvwhOEjKLm2Mpz7lHy3Osu7h6ZxqEsvoUxjIAWzXK20uIkkmrBfMbyOEtpGZNlwze0+5WS886I@lists.postgresql.org X-Gm-Message-State: AOJu0YxuQVMIzesHx6tcboQ9E1NVL4EVktUH6VE19moc9K+qqzDlgy9r S0COiZ1qKMU5AAIx6AtJMghbeceod8zapcVCNJAkPLSoM0FcvdUiUZ0m2uV8Bj0EcnHEe3mg5tU f1hrwCOVo8P44uariocFuw0FRfJM= X-Gm-Gg: ASbGncvwsZdiysn9iqs3SMwsBtQuJy1ESjtRuAz34YpBPEh+z7IQJamHKkp4NvGGh8C oguylaZN0AMYWdZp3AQ8dw+ZQVAybjNbjznn/wWCfq6N24DU+f5mffrENQ3bZ5Oq7svoEykXt/t eFgMTnllh5bfwGsRzALGPBjAbtVA== X-Google-Smtp-Source: AGHT+IEh2BE7JA6AbeSzIvCDDCWuhNpSdvd4kscGM3WGi3Bro7MTiTCSxdNvvNoYYUKv/h8TABMuqKmHYZXKkx44zaw= X-Received: by 2002:a17:907:7292:b0:ac7:31d5:20de with SMTP id a640c23a62f3a-ac738c11723mr743095266b.50.1743448176001; Mon, 31 Mar 2025 12:09:36 -0700 (PDT) MIME-Version: 1.0 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> <4118244.1743443395@sss.pgh.pa.us> In-Reply-To: <4118244.1743443395@sss.pgh.pa.us> From: Robert Haas Date: Mon, 31 Mar 2025 15:09:24 -0400 X-Gm-Features: AQ5f1JqV9YiCJt4j6Re9d2bulBvxmfnlT2qsnoxw9kaRs7S60_C0Tq9QX26mc2U Message-ID: Subject: Re: explain analyze rows=%.0f To: Tom Lane Cc: Ilia Evdokimov , Matthias van de Meent , Andrei Lepikhov , pgsql-hackers@lists.postgresql.org, Guillaume Lelarge , Matheus Alcantara , Alena Rybakina 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 Mon, Mar 31, 2025 at 1:49=E2=80=AFPM Tom Lane wrote: > 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. Oh, right. I've never really understood why we round off to integers, but the fact that we don't allow row counts < 1 feels like something pretty important. My intuition is that it probably helps a lot more than it hurts, too. --=20 Robert Haas EDB: http://www.enterprisedb.com