model-writtenrun 5022 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tom Lane proposed reusing commutatively equivalent EquivalenceClass clauses to avoid duplicate RestrictInfo construction and downstream selectivity calculations, attaching a patch that also removed the operator-OID check to avoid get_commutator() overhead #1.
- Richard Guo reviewed operand-order handling and supported the approach while suggesting an operator assertion #2; Tom declined the redundant check and reported instrumentation showing new clause construction falling from 9673 to 5142 across 26652 calls #3.
- Zhang Mingli supported the change and proposed combining the source and derived clause lists into one search loop, reporting expected-output differences from trying that alternative #4.
- Tom explained that broken-EquivalenceClass paths required keeping the lists separate and that preserving their distinction was useful #5, which Zhang accepted in the thread's last message #6.
- Tom subsequently committed the sole patchset #1 as a5fc46414d, adding only a function-header clarification about commutators and operand order; the proposed optimization landed without the assertion or combined-list alternative.