model-writtenrun 5117 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Hayato Kuroda reported aggregates regression failures on a 32-bit RHEL system using GCC 4.4.7, attaching diffs showing different GROUP BY and sort-key orders #1.
- Tom Lane suspected floating-point rounding after failing to reproduce with a newer compiler, and Andres Freund suggested that the old compiler's lack of standard excess-precision handling could explain the discrepancy #4 #5.
- Tom confirmed that competing key orders had identical estimated costs, then identified unreliable costing inputs and multiple implementation bugs that made him favor reverting the optimization before PostgreSQL 15 shipped #6 #7.
- Tom's comparison-count experiments showed that the estimate performed poorly for skewed groups and failed for a single distinct value, strengthening his recommendation to revert rather than make isolated fixes #8.
- After Jonathan S. Katz asked about scope and alternatives, Tom posted a draft full revert, explained that disabling enable_group_by_reordering would leave the problematic sort-cost changes active, and considered retaining simpler reordering based on distinct-value estimates #11 #12.
- Jonathan recommended a straight revert for PostgreSQL 15, and Tom abandoned salvaging the HEAD implementation after finding additional problems in pathkey and grouping-clause reordering; Tom then posted complete patches for both branches #15 #16 #17.
- David Rowley proposed removing the now-unused num_groupby_pathkeys field, but Tom wanted to preserve information about the origins of grouping pathkeys; they left the field in place and deferred broader restructuring #18 #19 #20 #21.
- Michael Paquier supported reverting both branches to avoid further interactions with unreliable costing, and Jonathan formally conveyed the release management team's request to revert PostgreSQL 15 and recommendation to revert HEAD #22 #23.
- Tom committed the HEAD patch from #17 unchanged as f4c7c410ee, with the corresponding PostgreSQL 15 backport preserving the unused node tag to avoid an ABI break.
- After the revert, Tom recorded a possible simplification for future work: grouping clauses need not follow reordered sort keys, potentially eliminating PathKeyInfo; Tomas Vondra acknowledged the resolution and apologized for the bugs, leaving the feature reverted and any redesign for future work #25 #26.