model-writtenrun 2077 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Andrei Lepikhov reported that conservative hash-bucket estimates could make multi-clause joins choose a much slower merge join, and proposed multiplying per-clause bucket-size and MCV estimates in #1.
- Alena Rybakina tested the proposal, reported examples with improved execution or memory use, and added a GUC for comparing the old and new estimates in #2; that testing switch was not retained in the eventual implementation.
- Andy Fan reproduced the improvement but found that the proposed bucket-size bound compared a fraction with a bucket count in #4, and Andrei corrected the comparison in #5.
- Tomas Vondra argued that multiplying estimates assumed independence and could harm queries with correlated columns, recommending extended ndistinct statistics instead in #6; he also identified broader join-cardinality estimation problems as a separate issue.
- After a substantial gap, Andrei replaced the multiplication proposal with an extended-statistics estimator in #7, grouping inner-side clauses by relation and returning unmatched clauses for the existing estimation logic.
- Andrei adjusted initialization and assertion placement for CI in #8, and Alexander Korotkov subsequently reformatted the code, renamed a bookkeeping list, and requested regression tests in #9.
- Andrei added a regression test showing extended statistics changing the chosen plan from merge join to hash join in #10, while Alexander withdrew his concern about the existing comparison direction in #11.
- Alexander polished the commit message, comments, and tests in #12, then committed that version with further comment-only edits as 6bb6a62f3c.
- A later feature-freeze concern was resolved when Matthias van de Meent pointed out that the feature had already landed a month earlier in #14, and Andres Freund acknowledged the date confusion in #15.
- Tender Wang found that the new estimator copied its clause list unnecessarily before returning for a single clause, and supplied a follow-up optimization in #17.
- Tender restored the comment placement following review in #20, then removed a redundant NIL initialization in #23 after Andrei requested that change in #21.
- Tom Lane committed Tender's final patch with additional variable comments, initialization cleanup, and braces as aadf7db66e, explaining in #24 that the benefit was clearer code rather than noticeable performance.
- Tender acknowledged the follow-up commit in #25, leaving both the extended-statistics feature and its cleanup landed with no further patch awaiting review in this thread.