model-writtenrun 5839 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Klaudie Willis reported that a large UPDATE on PostgreSQL 14.1 exhausted memory despite reducing work_mem, while batching the updates avoided the failure #1.
- After Tom Lane asked about triggers and requested a reproducible case, Klaudie isolated the problem to an expression index and supplied a reproducer requiring no partitioning #3 #4 #6 #9.
- Tom reproduced the leak and traced it to index_unchanged_by_update(), which copied index expression trees on every row even though its answer should remain constant; Vincent Veyron's unsuccessful reproduction was explained by his use of PostgreSQL 11 #8 #10 #11.
- Peter Geoghegan considered simplifying when the hint is supplied, but Tom advocated caching the result in IndexInfo to eliminate repeated computation and warned that changing that structure could break PostgreSQL 14's ABI #12 #13.
- Peter explained that the hint is a noisy signal for bottom-up B-tree deletion, that BEFORE-trigger changes need not be tracked precisely, and that ignoring partial-index predicates is intentional; after Tom questioned the flag's meaning, Peter clarified that true requests consideration of deletion before a page split #14 #15 #16.
- Following a holiday delay, Peter submitted the development-branch patch with two cached-state booleans in IndexInfo and proposed always supplying the hint on PostgreSQL 14 to avoid an ABI change #17 #18.
- Tom explained how pull_varnos() could be called without planner state, but Peter retained the existing walker because it directly handles attribute-number offsets and treated that refactoring as separate from the leak fix #19 #21 #22.
- Peter committed the submitted cache implementation with an additional explanatory comment and expanded commit message, using unconditional hinting for the PostgreSQL 14 backport; the thread ended with his confirmation that the fix was pushed, leaving only the optional pull_varnos() refactoring unresolved db6736c93c #22.