model-writtenrun 7159 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- David Rowley opened the thread with a proposal to restore the reverted Merge Append UNION optimization and separately fix incorrect handling of non-sortable columns, explaining that a fourth reported issue had prompted the revert and that release management would decide whether restoration belonged in PostgreSQL 17 or 18 #1.
- Heikki Linnakangas found the code generally sound, identified comment defects and tested constant-containing UNION queries that missed Merge Append opportunities; he also asked whether INTERSECT could benefit from the machinery #2.
- Álvaro Herrera requested a descriptive restoration commit message, and David supplied a combined restoration-and-fix patch with the expanded message and Heikki’s comment corrections #3 #4.
- Robert Haas committed the non-sortable UNION fix and xid regression test from the combined patch as c37267162e, retaining its comment corrections but separating the restoration; he explained that release management wanted both changes immediately, in separate commits, before the impending release #4 #5.
- David thanked Robert for completing the landing, then explained that constant-related optimization gaps likely involved discarded pathkeys and limited equivalence visibility across subqueries; INTERSECT support and further constant-handling improvements remained future work requiring more study, potentially for PostgreSQL 18 #6 #7.