Re: Remove vardata parameters from eqjoinsel_inner - Mailing list pgsql-hackers

From Richard Guo
Subject Re: Remove vardata parameters from eqjoinsel_inner
Date
Msg-id CAMbWs49ybFS2UPhm4veuTPJw8ZTsrjjXYQgE9Pi5neC2XvOrbg@mail.gmail.com
Whole thread Raw
In response to Remove vardata parameters from eqjoinsel_inner  (Ilia Evdokimov <ilya.evdokimov@tantorlabs.com>)
Responses Re: Remove vardata parameters from eqjoinsel_inner
Re: Remove vardata parameters from eqjoinsel_inner
List pgsql-hackers
On Fri, Feb 21, 2025 at 7:04 PM Ilia Evdokimov
<ilya.evdokimov@tantorlabs.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.

Thanks
Richard



pgsql-hackers by date:

Previous
From: "cca5507"
Date:
Subject: Re: Historic snapshot doesn't track txns committed in BUILDING_SNAPSHOT state
Next
From: Shubham Khanna
Date:
Subject: Re: Enhance 'pg_createsubscriber' to retrieve databases automatically when no database is provided.