Re: Memoize ANTI and SEMI JOIN inner - Mailing list pgsql-hackers

From David Rowley
Subject Re: Memoize ANTI and SEMI JOIN inner
Date
Msg-id CAApHDvqbVaiAV0xsk0G4W7mmN89vG-dZ1jTYQS=jT1041e82zA@mail.gmail.com
Whole thread Raw
In response to Re: Memoize ANTI and SEMI JOIN inner  (Alena Rybakina <a.rybakina@postgrespro.ru>)
Responses Re: Memoize ANTI and SEMI JOIN inner
List pgsql-hackers
On Mon, 31 Mar 2025 at 15:33, Alena Rybakina <a.rybakina@postgrespro.ru> wrote:
> I believe it's worth asserting that both inner_unique and single_mode are not true at the same time — just as a
safetycheck. 

add_paths_to_joinrel() just chooses not to populate inner_unique for
SEMI and ANTI joins because, as of today's master, it's pretty
pointless to determine that because the executor will short-circuit
and skip to the next outer tuple for those join types anyway. I don't
follow why having both these flags set would cause trouble. It seems
perfectly legitimate that add_paths_to_joinrel() could choose to set
the inner_unique flag for these join types, and if it did, the Assert
you're proposing would fail for no good reason.

David



pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: Reducing memory consumed by RestrictInfo list translations in partitionwise join planning
Next
From: vignesh C
Date:
Subject: Re: Commit fest 2025-03