Re: Do not scan index in right table if condition for left join evaluates to false using columns in left table - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Do not scan index in right table if condition for left join evaluates to false using columns in left table
Date
Msg-id 3517444.1733613195@sss.pgh.pa.us
Whole thread Raw
In response to Re: Do not scan index in right table if condition for left join evaluates to false using columns in left table  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On 2024-12-07 17:06:52 -0500, Tom Lane wrote:
>> One could imagine that we split up the join filter conditions into
>> "depends on RHS" and "doesn't depend on RHS" subsets, and make the
>> nestloop plan node evaluate the latter set only once per LHS row,
>> and then skip the inner-side scan when that condition fails.

> As I wrote in my other email, I'm also somewhat dubious it's worth having
> explicit code for this in nodeNestloop.c.

Yeah.  Your idea of pushing the "doesn't depend on RHS" subset into
a one-time Result filter atop the RHS is interesting though.  Then we
don't need any new executor machinery, but we pay for that with a more
complex planner patch.  Not sure how hard that would be.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Do not scan index in right table if condition for left join evaluates to false using columns in left table
Next
From: Tomas Vondra
Date:
Subject: Re: CREATE SUBSCRIPTION - add missing test case