public inbox for [email protected]  
help / color / mirror / Atom feed
From: Andrei Lepikhov <[email protected]>
To: Frits Jalvingh <[email protected]>
To: pgsql-performa. <[email protected]>
Subject: Re: Question about nested loops..
Date: Thu, 9 Oct 2025 12:00:29 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAKhTGFURW_AvZgWR20x-kWfSeGts=OWcuOnanhM-dwU9RjiRPw@mail.gmail.com>
References: <CAKhTGFURW_AvZgWR20x-kWfSeGts=OWcuOnanhM-dwU9RjiRPw@mail.gmail.com>

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





view thread (3+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Question about nested loops..
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox