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 Andres Freund
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 prmcdabei4jl24v7ubbd6rdwjwh4e2c3zgycq6nyxt3m5zo3qx@mz2i6l6r4jdv
Whole thread Raw
In response to Do not scan index in right table if condition for left join evaluates to false using columns in left table  (Илья Жарков <izharkov1243@gmail.com>)
Responses Re: Do not scan index in right table if condition for left join evaluates to false using columns in left table
Re: Do not scan index in right table if condition for left join evaluates to false using columns in left table
List pgsql-hackers
Hi,

On 2024-12-08 09:23:42 +0700, Andrei Lepikhov wrote:
> To determine how difficult it could be, I wrote a prototype (very raw),
> which shows how it works in action and how many subsystems we have to touch.

Cool!


> Also, I wonder why you think it could work with NestLoop only.

It doesn't seem to apply to mergejoins. For hashjoins, it doesn't seem worth a
separate evaluation of a expression - something which has noticeable overhead
on its own - given that the cost of a lookup in the hashtable isn't
particularly high. Compare that to the nestloop case where you always need an
indexscan and often will have more complicated subtrees being executed
unnecessarily on the inner side.


> I think avoiding touching a hash table and an index under MergeJoin can also
> be beneficial.

How would you get significant wins for mergejoins? You need to go through both
inner and outer anyway?

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: [PATCH] Add roman support for to_number function
Next
From: Tom Lane
Date:
Subject: Re: Do not scan index in right table if condition for left join evaluates to false using columns in left table