| From: | Andrei Lepikhov <lepihov(at)gmail(dot)com> |
|---|---|
| To: | Ilia Evdokimov <ilya(dot)evdokimov(at)tantorlabs(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Cc: | Robert Haas <robertmhaas(at)gmail(dot)com> |
| Subject: | Re: Show 'Rows Removed by Filter' with two fractional digits in EXPLAIN |
| Date: | 2026-11-06 14:59:42 |
| Message-ID: | 203e58d3-3b6a-4c16-b0f7-97dba8680466@gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On 06/11/2026 14:17, Ilia Evdokimov wrote:
> On 11/6/26 11:57, Andrei Lepikhov wrote:
>> The patch is a single-line change in show_instrumentation_count() plus two
>> tests. It is a concept, not a finished patch: I have not regenerated the other
>> expected outputs, where many values will change from "N" to "N.00" - you can
>> find a sketch for that in 0002-* file.
>
> If we switch to fractional row counts, we should also remember to update the
> relevant examples in the doc, including "Rows Removed by Filter", "Rows Removed
> by Index Recheck", "Rows Removed by Conflict Filter", "Rows Removed by Join
> Filter".
>
> Regardless of whether we change this output format, it would be be useful to
> document in the "Using EXPLAIN" section (perform.sgml), in the paragraph
> describing "Rows Removed", that these counts are averages per execution of the
> node. This is already the case, but the paragraph does not mention it.
Ok, my AI coding agent detects such places quite nicely. See the patch v0-0002-*
in attachment.
>> rule as actual rows. The options I see are:
>>
>> 1. Always print two digits, as actual rows do now.
>> 2. Leave the math to users and print exact totals without dividing by nloops.
>>
>> The second approach is a much bigger change, with obvious pros and cons.
>> The first one is simpler and more conservative, and it is what the attached
>> patch does. In [1], depesz describes how the switch to fractional actual rows
>> affected his explain parser, and it needed only a small fix. So I expect this
>> change to be similarly harmless for tools.
>
> I also prefer the first option, as it is more conservative and keeps these
> counters consistent with actual rows.
Hmm, I wouldn't say that I prefer the first approach. Reading explains quite
frequently that I'd prefer sums on all cycles for sure - sometimes huge work is
hidden in the third or even sixth digit after the point - because it is the
first non-zero digit. But I understand the reasoning and agree - it is a
contradictory question. So, No.1 is just a compromise.
--
regards, Andrei Lepikhov,
pgEdge
| Attachment | Content-Type | Size |
|---|---|---|
| v0-0001-Switch-JOIN-and-SCAN-filter-explain-output-to-flo.patch | text/plain | 4.5 KB |
| v0-0002-Adjust-regression-tests-and-docs-to-fractional-Ro.patch | text/plain | 23.7 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Andrew Dunstan | 2026-11-06 15:13:14 | Re: run pgindent in CI |
| Previous Message | Robert Haas | 2026-11-06 14:41:47 | Re: O(N^3) planning time in choose_plan_name() since 8c49a484e8e |