model-writtenrun 5615 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Jan - Apr 2021 · 8 entries
- Amit Langote proposed replacing SPI queries for referenced-key existence checks with direct unique-index scans and tuple locking in #1, reporting roughly twofold gains for ordinary tables and larger gains for partitioned tables.
- The initial scope deliberately excluded checks that scan referencing tables because their access paths are less predictable; Corey Huinker supported the focused approach in #11, while Amit retained the existing pk_ terminology but renamed the main function ri_ReferencedKeyExists() in #12.
- Early reviews by Zhihong Yu, Japin Li, and Corey Huinker corrected partition-key assertions, a missing switch break, allocation cleanup, and redundant work across #5, #12, #16, and #19.
- Keisuke Kuroda confirmed that the patch eliminated cached SPI plans for inserts in #28, while Amit explained in #23 that separate plan-sharing work remained useful for operations still using SPI.
- Kyotaro Horiguchi identified obsolete and misleading PK query codes in #29; Amit removed them in #30, which Corey tested and marked ready for a committer in #31.
- Tom Lane challenged the implementation's behavioral equivalence in #34, identifying missing permission and owner-context handling, possible access-method assumptions, snapshot differences, and duplicated tuple-locking code.
- Amit explained the existing RLS bypass and foreign-table limitations in #35, investigated why crosscheck snapshots were unused for these SELECT operations in #36, and added permission checks, index-specific strategy lookup, and shared ExecLockTableTuple() machinery in #37.
- Concurrent partition-detachment changes prompted snapshot adjustments in #38; Alvaro Herrera's review in #40 then led to PartitionDirectory protection in #41 against invalidation during partition lookup.
Jul 2021 · 1 entry
- Following a July rebase in #44, Corey reviewed the accumulated locking, snapshot, and partitioning changes, passed check-world, and again marked the patch ready in #45.
Nov 2021 - Jan 2022 · 4 entries
- Tom's renewed review in #46 distinguished transaction-snapshot visibility for FK inserts from fresh-snapshot checks for replacement PK rows, and his reproducer in #48 demonstrated inconsistent REPEATABLE READ behavior between plain and partitioned referenced tables.
- Discussion in #49, #52, and #53 explored separating partition-detachment handling from row visibility while preserving an appropriate active snapshot; repairing PostgreSQL 14 independently remained an open concern.
- Amit substantially reorganized the series in #54: a new isolation-test patch documented the existing visibility bug, the implementation separated partition-lookup snapshots from index-scan snapshots, and leaf-partition lookup moved into execPartition.c.
- After the December rebase in #56, Zhihong caught a negative partition-index access in #57; Amit fixed it in #58, Corey reported successful check-world testing in #59, and further cleanup followed in #61.
Mar - May 2022 · 4 entries
- An upstream API change required a dedicated foreign-key index lookup in #62; subsequent revisions applied Zhihong's small corrections in #64 and rebased and renamed the exported partition helper in #65.
- Alvaro committed the unchanged isolation-test patch from #65 as 00cb86e75d, then committed the RI rewrite as 99392cdd78 with additional partition-traversal edits; the latter explicitly left the PostgreSQL 14 visibility bug unfixed because this rewrite was too invasive to backpatch.
- After those landings, Amit reported in #66 that the proposal had been returned with feedback following discussion on the committers list, accepting that a renewed design should address all RI checks and actions; the supplied thread does not identify a revert commit.
- At the thread's end in #67, broader work remained unresolved: Amit weighed a small planner for referencing-table scans and restricted update/delete executor interfaces for CASCADE and SET actions, while questioning whether their complexity justified replacing SPI in those cases.