Re: Key joins - Mailing list pgsql-hackers

From Joel Jacobson
Subject Re: Key joins
Date
Msg-id b91d71e3-1628-4340-affe-662e8948f7d8@app.fastmail.com
Whole thread
Responses Re: Key joins
List 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



pgsql-hackers by date:

Previous
From: Alexander Lakhin
Date:
Subject: Re: Improving tracking/processing of buildfarm test failures
Next
From: "Greg Burd"
Date:
Subject: Re: Add RISC-V Zbb popcount optimization