From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Richard Guo <guofenglinux(at)gmail(dot)com> |
Cc: | Ilia Evdokimov <ilya(dot)evdokimov(at)tantorlabs(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Remove vardata parameters from eqjoinsel_inner |
Date: | 2025-03-27 13:40:16 |
Message-ID: | 1901909.1743082816@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Richard Guo <guofenglinux(at)gmail(dot)com> writes:
> On Fri, Feb 21, 2025 at 7:04 PM Ilia Evdokimov
> <ilya(dot)evdokimov(at)tantorlabs(dot)com> wrote:
>> When calculating selectivity for an inner equijoin, we call
>> eqjoinsel_inner, which uses unused parameters vardata1 and vardata2.
>> These parameters might have been left behind accidentally when we moved
>> getting sslots out of the function. I suggest removing them, as they can
>> be added back at any time if needed. I attached patch with fixes.
> Yeah, these parameters haven't been used since a314c3407, when we
> moved get_variable_numdistinct and get_attstatsslot out of
> eqjoinsel_inner and eqjoinsel_semi to avoid repetitive information
> lookup when we call both eqjoinsel_inner and eqjoinsel_semi.
> I'm wondering whether we should also remove parameter vardata1 from
> eqjoinsel_semi. vardata2 is still needed though to clamp nd2 to be
> not more than the rel's row estimate.
I do not believe this change is worth the code churn. In the first
place, we may well need those values again someday. In the second
place, the savings would be negligible. (In fact, since
eqjoinsel_inner probably gets inlined at its sole call site, the
savings would likely be completely nonexistent.) If the caller
could avoid calculating the vardata info at all, that would be
worth thinking about, but I think it can't.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Andres Freund | 2025-03-27 13:40:29 | Re: Draft for basic NUMA observability |
Previous Message | Yurii Rashkovskii | 2025-03-27 13:38:43 | Re: Add Postgres module info |