model-writtenrun 1004 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Dec 2024 · 1 entry
- Amit Langote opened the thread with direct primary-key index probes intended to reduce bulk foreign-key checking costs, alongside partition-snapshot refactoring and pluggable RI plans; the proposal preserved permission checks and concurrent-update rechecks while leaving temporal checks on SQL #1.
Apr 2025 · 1 entry
- After missing the PostgreSQL 18 cycle, Amit handed further development to Junwang Zhao and described their revised hybrid design: optimize straightforward checks while retaining SPI for cases such as partitioned referenced tables and temporal constraints #2 #3 #5.
Oct - Dec 2025 · 1 entry
- Junwang submitted the narrower fast path and metadata caching, reporting substantial insertion and update improvements but little additional benefit from metadata caching alone #6.
Feb - Apr 2026 · 28 entries
- Amit combined Junwang's patches into a complete core fast path and introduced trigger-batch callbacks to retain relations, scans, slots, and snapshots across checks; he also relayed David Rowley's suggestion to batch keys using SK_SEARCHARRAY #7.
- The next series implemented buffering and single-column array probes, introduced FastPathMeta, and fixed a scan-allocation lifetime problem exposed by Tomas Vondra's testing #9.
- Tomas reported broad benchmark improvements without observed small-insert regressions, supported a batch size of 64, and explained that index-prefetch integration was separate work #10 #12.
- Junwang simplified violation reporting and validation execution and proposed reusing the FK tuple slot; Amit retained those changes while keeping multi-column keys on the per-row probing fallback #14 #15.
- Amit corrected snapshot semantics to use GetTransactionSnapshot(), removed the redundant repeatable-read crosscheck, separated cached execution from validation, and combined buffering with array probing; he also suppressed nested callback firing to prevent premature cache teardown #15.
- Haibo Yan identified overly broad transaction-lifetime allocations and requested clearer batch-size and lifecycle documentation, leading Junwang to introduce dedicated scan and flush contexts and then fold that fix into the batching patch #16 #17 #18.
- After documenting the visibility tradeoff of snapshot caching, Amit decided to remove it: snapshots and scan descriptors would be fresh for each flush, while relations and slots remained cached, and the series shrank to core fast-path and batching patches #20 #21 #22.
- Junwang's further feedback led to placing buffered tuples in flush_cxt, and Amit moved permission checks into every flush so privilege changes between flushes would be respected #23 #24.
- The core component of #24 landed as 2da86c1ef9, with an index-scan API rebase; action triggers remained on SPI because finding and modifying referencing rows requires broader executor machinery.
- Chao Li reported a use-after-release of constraint catalog data, which Amit had independently fixed already; further CLOBBER_CACHE_ALWAYS testing exposed stale constraint information and metadata invalidation problems, prompting another fix alongside the remaining batching patch #25 #26 #31.
- Junwang endorsed the invalidation fix, and Amit subsequently made FastPathMeta independent of comparison-cache pointers by copying FmgrInfo values; that first component of #35 landed as edee563456, leaving batching alone #33 #36.
- Junwang's review prompted passing constraint information into batch flushing, while Amit avoided array construction for single-row batches and added an index-AM capability assertion and clearer callback naming #37 #38 #39.
- Chao Li caught a duplicated comment phrase, and Amit landed the batching patch from #39 with that correction and other editorial changes as b7b27eb41a #40 #41.
- Chao then demonstrated that deferred checks at COMMIT missed batching because query_depth was negative and supplied a MyTriggerDepth-based fix; Amit replaced that overly broad test with a dedicated AFTER-trigger firing counter #42 #44.
- After Chao checked normal and error paths, the revised deferred-batching fix landed unchanged apart from whitespace as 5c54c3ed1b, retaining Chao's authorship credit #45 #46.
- Evan Montgomery-Recht reported PostGIS crashes when nested C-level SPI released resource-owner references before batch teardown, proposing resource transfers and a new test module; he separately suggested making the recheck helper's key count explicit #47.
- Amit attached the explicit-nkeys cleanup, which landed unchanged as e1cc57fabd #48.
- For the crash, Amit found that Evan's original test did not reproduce the required lifetime mismatch, added an explicit child resource owner and nested AFTER-trigger case, and replaced resource transfers with callbacks matched to their firing depth #49.
- Amit then proposed storing callbacks directly at their query level, with a separate list for deferred firing, and added a cleanup moving the firing-depth counter into AfterTriggersData #50.
- Chao identified unsafe re-entrant callback registration, and Amit incorporated a firing_batch_callbacks guard while consolidating the query-level storage design into the main fix #51 #52.
- jie wang spotted a comment typo, Chao endorsed the main fix and counter cleanup, and strk confirmed that both Evan's original proposal and Amit's revised callback fix resolved the PostGIS crash #53 #56 #59.
- The main callback-lifetime component of #52 landed with editorial changes as 34a3078629, while the test module remained separate #60.
- Chao noticed that jie's previously reported typo had survived the landing, prompting the discussion-derived one-line correction 03029409b4 #61 #62.
- The firing-depth cleanup from #52 landed as d6e96bacd3, and Amit resent only the test_spi_resowner module while questioning feature-freeze policy and the appropriate home for its coverage #63.
- strk confirmed the crash was gone on the updated development branch, while Haibo reviewed the remaining test module and requested exception-safe resource-owner handling, failure-then-success coverage, and shorter comments #64 #65.
- Amit decided to hold the test module unless others strongly wanted it, judging its narrow extension-specific regression coverage insufficient to justify permanent maintenance and test-runtime costs #66.
- Peter Eisentraut proposed propagating mutable constraint-info pointers instead of casting away const; Amit accepted the code unchanged and supplied explanatory commit text when landing it as 1b9dc2cb75 #67 #68 #69.
- At the thread's end, the core fast path, batching, subsequent fixes, and const cleanup had landed, while the proposed SPI resource-owner test module remained on hold and partitioned, temporal, and action-trigger extensions remained outside the implemented scope #66 #69 2da86c1ef9.