model-writtenrun 311 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Suyang Zhong reported that an IN predicate matched one row but filtering with it counted two under a nondeterministic collation, reproducing the problem on development and beta versions in #1.
- Andrey Rachitskiy traced the duplicate results to RHS unique-ification using the expression's collation instead of the join's input collation and proposed labeling the expression with canonicalize_ec_expression() in #2; Tender Wang endorsed the approach and suggested the comment adopted in #4 through his review in #3.
- Alexander Korotkov supported fixing the recorded expression once for all consumers, expanded the tests to cover sorting, hashing and uniqueness shortcuts, and established that the bug required backpatching through PostgreSQL 14 in #5.
- Richard Guo requested reuse of existing tables and enable_groupagg in #6; Andrey reused the tables in #7 but initially retained enable_sort for backpatch consistency, then reported successful cross-branch testing and expected-plan differences in #8.
- Alexander intended further test cleanup in #9 but accidentally attached the older patch from #5; after Richard identified the discrepancy and reiterated the enable_groupagg request in #10, Alexander supplied the corrected existing-table version in #11.
- Richard's detailed review in #15 retained the fix while simplifying its placement and comments, replacing table mutations and statistics overrides with transaction-local planner settings, and using test3cs to cover both duplicate values and the older branches' unique-index shortcut; he also removed a redundant plain-semijoin test and documented the DISTINCT-subquery benefit.
- Alexander accepted Richard's corrections and changed the tests to count(*) in #16, reporting that this preserved useful plans with either aggregation-control setting through PostgreSQL 14; Richard explicitly approved that version in #18.
- The final attachment #16 became 1ac292cb14 with unchanged backend logic and light regression adaptations to enable_sort and expected Sort Key rendering.
- Alexander confirmed that the fix was committed and backpatched in #19 and planned to monitor the buildfarm; the closing reply #20 raised no further issue, leaving no outstanding patch work in the thread.