Re: Key joins

From: Arne Roland <arne(dot)roland(at)malkut(dot)net>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Joel Jacobson <joel(at)compiler(dot)org>, Tomas Vondra <tomas(at)vondra(dot)me>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, 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>, Alexander Melnikov <asmmp(at)protonmail(dot)com>
Subject: Re: Key joins
Date: 2026-10-08 20:15:03
Message-ID: bd598b83-9371-4857-90e4-4d5ded4613b5@malkut.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers,

the attached patch is rebased on master. We also decided to drop the
FILTER (WHERE ...) syntax, to avoid further discussions about that
syntax hold back the patch itself.

The biggest change is the syntax change affecting the whole chain, but
mostly our first commit. FOR KEY now names a table on both sides of the
arrow, left operand first: a JOIN b FOR KEY a_tab (id) <- b_tab (a_id)
replaces the old FOR KEY (a_id) -> a_tab (id), which named only the
referenced table. The arrow still points from the referencing side to
the referenced side. This moves the nice canonical form from all left
arrows to all forward right arrows. This lead to a lot of mechanical
changes in the tests. I did not review all of them by hand.

This patch also patches the debug section of pg_rewrite_query (the
roundtrip eq check). Because proofDependencies are never written,
we skip the serialization tests for FOR KEY JOIN dependencies. This is
not done to address any live bugs, but avoid failing tests with
debug_write_read_parse_plan_trees enabled. This is part of the Record
and revalidate member of the series.

Regards
Arne

Attachment Content-Type Size
v15-0004-Derive-key-join-proof-facts-from-GROUP-BY-and-DI.patch.gz application/gzip 16.2 KB
v15-0003-Prove-FOR-KEY-joins-over-derived-inputs.patch.gz application/gzip 40.8 KB
v15-0005-Prove-FOR-KEY-joins-whose-referenced-input-is-fi.patch.gz application/gzip 40.8 KB
v15-0011-Add-psql-tab-completion-for-FOR-KEY-joins.patch.gz application/gzip 11.6 KB
v15-0008-Extend-stored-FOR-KEY-proofs-to-SQL-routine-bodi.patch.gz application/gzip 7.7 KB
v15-0006-Serialize-concurrent-routine-definition-changes.patch.gz application/gzip 1.7 KB
v15-0007-Record-and-revalidate-FOR-KEY-proof-dependencies.patch.gz application/gzip 79.4 KB
v15-0010-Add-information_schema.view_constraint_usage.patch.gz application/gzip 2.8 KB
v15-0001-Add-FOR-KEY-join-clause-and-parse-time-proof.patch.gz application/gzip 58.5 KB
v15-0002-Add-error-details-to-FOR-KEY-join-rejections.patch.gz application/gzip 7.7 KB
v15-0009-Extend-stored-FOR-KEY-proofs-to-row-level-securi.patch.gz application/gzip 6.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2026-10-08 20:21:17 Re: hashjoins vs. Bloom filters (yet again)
Previous Message Hannu Krosing 2026-10-08 20:13:37 Re: [PATCH] Extensible ReadyForQuery wire protocol message and C hook, for connection pools and WAIT FOR LSN