model-writtenrun 2321 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Maksim Milyutin proposed simplifying COALESCE with one surviving argument so that its wrapper would no longer obstruct planner transformations such as outer-join reduction, attaching the initial patch in #1.
- Tom Lane considered the optimization reasonable because its check was cheap, requested explanatory comments, and asked for commitfest tracking in #2.
- Maksim explained that regression tests needed second COALESCE arguments to preserve intentional expression wrappers, and separately reported duplicate grouping keys that he suspected arose from PlaceHolderVars in #3.
- Maksim submitted the revised series with comments and regression-test adjustments in #4, retaining the original optimizer logic.
- Tom committed the revised series as 931766aaec with comment edits and repeated arguments instead of dummy constants in the tests, explaining in #5 that this preserved NULL behavior; the proposed optimization was fully landed, while the separate grouping-key observation in #3 received no resolution in this thread.