Re: Question about nested loops.. - Mailing list pgsql-performance

From Andrei Lepikhov
Subject Re: Question about nested loops..
Date
Msg-id cf8b21ef-42db-45f0-b71d-6f5f2d1673a0@gmail.com
Whole thread Raw
In response to Question about nested loops..  (Frits Jalvingh <jal@etc.to>)
List pgsql-performance
On 9/10/2025 10:52, Frits Jalvingh wrote:
> I do not understand why the simpler query (without the self join) 
> produces a plan that seems to require nested loops, I hope someone can 
> explain.
It seems obvious. You have a join clause:
'enheid.id_h_eenheid = huurovereenkomst_s._l_eenheid'

One side of this clause fits the underlying relation, but another one 
does not (references the external relation).
According to the HashJoin rules, the hash join clause is quite strict: 
each side should depend on only the left or right side of the join. So, 
it is just impossible here.
What can be done here without rewriting the query? This subject requires 
investigation to determine if the outer part of the hash clause can be 
parameterised or not.

-- regards, Andrei Lepikhov
pgEdge



pgsql-performance by date:

Previous
From: Frits Jalvingh
Date:
Subject: Question about nested loops..