Re: Key joins

From: "Joel Jacobson" <joel(at)compiler(dot)org>
To: "Laurenz Albe" <laurenz(dot)albe(at)cybertec(dot)at>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: "Arne Roland" <arne(dot)roland(at)malkut(dot)net>, "Anders Granlund" <anders(dot)granlund(dot)0(at)gmail(dot)com>, "Andreas Karlsson" <andreas(at)proxel(dot)se>, "Vik Fearing" <vik(at)chouppes(dot)com>
Subject: Re: Key joins
Date: 2026-06-01 20:36:36
Message-ID: b91d71e3-1628-4340-affe-662e8948f7d8@app.fastmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jun 1, 2026, at 22:06, Joel Jacobson wrote:
> -- Rejected: the view is the PK side and lacks row coverage.
> SELECT *
> FROM orders AS o
> JOIN active_customers AS ac FOR KEY (id) <- o (customer_id);
> ERROR: key join from referencing relation o to referenced relation ac
> cannot be proven
> ERROR: key join from referencing relation o to referenced relation ac
> cannot be proven
> LINE 3: JOIN active_customers AS ac FOR KEY (id) <- o (customer_id);
> ^
> DETAIL: Not every o (customer_id) value can be proven to have a
> matching ac row. Referenced relation ac is filtered before this key
> join. The relevant operation occurs inside view public.active_customers.

Ops, that extra ERROR: line was a mistake, sorry about that.

The corresponding subsection has now also been fixed in the web version:
https://keyjoin.org/#sec7.4.13

/Joel

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Burd 2026-06-01 20:54:27 Re: Add RISC-V Zbb popcount optimization
Previous Message surya poondla 2026-06-01 20:32:29 Re: pg_rewind does not rewind diverging timelines