model-writtenrun 8066 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Keisuke Kuroda reported that transactions creating, dropping, or truncating many tables saturated a logical-replication walsender CPU, with profiling showing repeated invalidations spending most of their time scanning the relation-file mapping cache #1.
- Amit Kapila proposed using command-end invalidation WAL records to queue individual invalidation changes while retaining the transaction-wide collection for cleanup after aborts or errors; he explained that an earlier implementation had dropped this dual representation #2 #6.
- After Keisuke outlined an implementation, Dilip Kumar recovered the relevant code from earlier logical-decoding work and posted a patch that executed invalidations from the change stream instead of replaying every transaction invalidation at each command-ID increment #7 #8.
- Amit requested clearer explanations of the two invalidation collections, and Keisuke reported passing installcheck-world tests and a reduction from roughly 230 seconds to at most one second when truncating 1,000 partitions; backporting was ruled out because the approach depended on PostgreSQL 14 functionality #9 #10 #11.
- Dilip identified existing abort-test coverage and revised the comments, then incorporated Amit's request to record transaction-wide invalidations before queuing potentially executable changes, simplify allocation, and remove obsolete declarations and comments #12 #13 #16 #17.
- Keisuke supplied a full revised patch correcting the palloc argument introduced during cleanup, confirmed the performance improvement again, and traced an apparent missing TRUNCATE output to his own build mistake #18.
- After Keisuke clarified that the benchmark's slow operation was TRUNCATE rather than INSERT, Dilip independently reproduced the improvement from several minutes to under one second #21 #23.
- Simon Riggs requested coverage of transactions mixing committed and aborted subtransactions; Amit clarified the streaming-abort considerations, and Dilip subsequently reported similar performance benefits with a mixed commit/rollback workload #24 #27 #29 #31.
- Amit prepared the final attachment with consistent switch-case placement, removal of an unused pointer increment, and formatting cleanup, and Dilip accepted those changes #32 #33.
- Amit committed #32 unchanged as d7eb52d718 and announced the push; the remaining messages acknowledged completion, with no outstanding patch or further fix proposed by the thread's close #34 #36 #37 #38.