Re: Question about nested loops..

From: Andrei Lepikhov <lepihov(at)gmail(dot)com>
To: Frits Jalvingh <jal(at)etc(dot)to>, "pgsql-performa(dot)" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Question about nested loops..
Date: 2025-10-09 10:00:29
Message-ID: cf8b21ef-42db-45f0-b71d-6f5f2d1673a0@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Peter Geoghegan 2025-10-09 21:53:49 Re: Poor performance with row wise comparisons
Previous Message Frits Jalvingh 2025-10-09 08:52:12 Question about nested loops..