From: | Ilia Evdokimov <ilya(dot)evdokimov(at)tantorlabs(dot)com> |
---|---|
To: | Robert Haas <robertmhaas(at)gmail(dot)com>, Andrei Lepikhov <lepihov(at)gmail(dot)com> |
Cc: | Matheus Alcantara <matheusssilv97(at)gmail(dot)com>, Guillaume Lelarge <guillaume(at)lelarge(dot)info>, Daniel Gustafsson <daniel(at)yesql(dot)se>, Ibrar Ahmed <ibrar(dot)ahmad(at)gmail(dot)com>, "Gregory Stark (as CFM)" <stark(dot)cfm(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, Peter Geoghegan <pg(at)bowt(dot)ie>, vignesh C <vignesh21(at)gmail(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Re: explain analyze rows=%.0f |
Date: | 2025-02-11 19:18:20 |
Message-ID: | 9d06ca26-481a-4bab-a4f9-92e94385c11c@tantorlabs.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 11.02.2025 20:41, Robert Haas wrote:
> On Tue, Feb 11, 2025 at 12:14 PM Andrei Lepikhov <lepihov(at)gmail(dot)com> wrote:
>> I support the idea in general, but I believe it should be expanded to
>> cover all cases of parameterised plan nodes. Each rescan iteration may
>> produce a different number of tuples, and rounding can obscure important
>> data.
>>
>> For example, consider five loops of a scan node: the first loop returns
>> nine tuples, and each other - zero tuples. When we calculate the
>> average, 9 divided by 5 equals 1.8. This results in an explanation that
>> indicates "rows = 1," masking almost 40% of the data.
>>
>> Now, if we apply the same two loops but have a total of 900,000 tuples,
>> then 400,000 masked tuples represent a significant portion of the data.
>>
>> Moreover, switching to a floating-point type for row explanations in
>> each parameterised node would provide a more comprehensive view and add
>> valuable information about the parameterisation of the node, which may
>> not be immediately apparent.
> I agree strongly with all of this. I believe we should just implement
> what was agreed here:
>
> https://www.postgresql.org/message-id/21013.1243618236%40sss.pgh.pa.us
>
> Let's just display 2 fractional digits when nloops>1, else 0, and call it good.
>
Thank you for your review!
With such example, it's hard to disagree with it. This would really add
valuable information. Taking all opinions into account, I have updated
the patch v8. I have also included a check for the case where there are
only zeros after the decimal point. We do not want to clutter the rows
with unnecessary zeros.
--
Best regards,
Ilia Evdokimov,
Tantor Labs LLC.
Attachment | Content-Type | Size |
---|---|---|
v8-0001-Clarify-display-of-rows-as-decimal-fractions.patch | text/x-patch | 8.4 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2025-02-11 19:20:13 | Re: Bump soft open file limit (RLIMIT_NOFILE) to hard limit on startup |
Previous Message | Corey Huinker | 2025-02-11 19:02:21 | Re: Statistics Import and Export |