On Mon, Jun 1, 2026, at 17:35, Tomas Vondra wrote:
> The other idea is that Joel Jacobson's patch with KEY joins might allow
> proving more joins are 1:1, not just joins on foreign keys. But I
> haven't thought about that very much, and I'm not sure it's very useful
> for such joins (it's probably not a starjoin-like query, and does not
> have so many number of join orders).

I find this thread very interesting, and like Tomas explained,
I'm interested in examining if there could possibly be an opportunity
for some shared infrastructure here.  I intend to conduct such research
in the upcoming weeks, and report back with my findings.

Just to clarify one thing; a key join is always backed by an underlying
foreign key (referential constraint). What I think Tomas means with
"not just joins on foreign keys" is that that key joins not only works
between two base tables, but also through derived tables.
To explain what that means, maybe an example is easiest,
a good one I recommend is: https://keyjoin.org/#sec7.3.1

/Joel


Reply via email to