model-writtenrun 3582 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Richard Guo reported that constant restrictions could hide partition-key equalities and prevent partitionwise joins in #1, then demonstrated that merely reordering equivalent join clauses could change whether partitionwise joins were generated in #3.
- Richard's first patch generated all possible equivalence-class-derived join clauses for partition-key matching in #5; Alvaro Herrera suggested consulting equivalence classes directly in #9, while Dilip Kumar's review prompted clarification that missing clauses also occur without constants in #11 and #12.
- Etsuro Fujita argued that the change was an improvement rather than a bug fix because reordering clauses provided a workaround for the regression example in #14, and Michael Paquier changed its classification in #15.
- After Richard refreshed the patch in #18, Tom Lane rejected generating extra RestrictInfos as expensive and intrusive, supplying a replacement that checks exprs_known_equal() with explicit operator-family semantics in #19.
- Tom and Richard retained restriction-clause matching alongside equivalence-class checks because outer-join equalities were not fully represented by the equivalence-class machinery, and Tom reported that an equivalence-class-only experiment failed regression tests in #21 and #22.
- Richard resumed with a rebase in #26; Ashutosh Bapat suggested clearer variable names and ways to reduce repeated equivalence-class scans in #27, and Richard adopted the names while retaining pairwise checks because their cost scales with join degree in #29.
- Following another rebase in #32, the patch was returned for lack of reviewer interest in #33; Richard revived it in #34 after confirming the issue persisted, adding a fuller commit message.
- Ashutosh's renewed review proposed preferring partition-key clauses, broader tests and documentation, and eventually using only equivalence classes in #36; Richard kept general documentation outside this patch and demonstrated why constant restrictions on multicolumn partition keys defeat the clause-preference alternative in #37 and #39.
- Robert Haas questioned how often the optimization would help and requested evidence that its planning overhead was negligible in #41 and #43; Richard's five-way-join benchmark with three partition keys and 1,000 partitions found the overhead within measurement variation in #44.
- Richard committed #34 as 9b282a9359, preserving its implementation while adding a multilevel-partition regression case and expanding the commit message, then announced the landing in #45.
- After the landing, Richard explained a reported prepared-statement performance problem in #46: newly enabled partitionwise joins produced an Append of joins whose branches could not undergo the initial pruning available to the previous plan, leaving costing and preservation of alternative paths for separate work.
- The thread ended with Richard acknowledging that equivalence-class-only matching remained a larger future redesign in #47, and Ashutosh emphasizing that partitionwise joins combined with runtime pruning would still be needed when many partitions survive in #48; the patch remained committed, with no follow-up fix or revert attached here.