model-writtenrun 6010 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Richard Guo reported that GROUP BY column removal could merge a real row containing NULL with rows null-extended by an outer join, demonstrating a query that returned one group instead of two in #1.
- The patch in #1 tracks outer-join nullability through varnullingrels, requires NOT NULL index columns for affected relations, and adds a regression test preserving both grouping columns.
- wenhui qiu endorsed the diagnosis and implementation in #2, while suggesting an optional bms_free(nullable_relids) call.
- Richard Guo rejected that suggestion in #3, explaining that the function leaves its other bitmapsets to planner-context cleanup and that freeing this small allocation separately would be inconsistent.
- 48938780c3 landed the patch from #1 unchanged, and Richard Guo closed the thread by confirming the push and backpatching through PostgreSQL 18 in #3.