model-writtenrun 4958 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- David Geier proposed skipping MCV loading when either join attribute is unique, reporting substantial planning-time savings #1; after Tom Lane requested a concrete example #2, David demonstrated that the wasted work is loading the non-unique side's unused MCV list #3.
- Tomas Vondra proposed checking whether both sides actually have MCV slots, covering uniform distributions and other cases beyond declared uniqueness #4; Tom endorsed that approach #5 and supplied a replacement patch using existing get_attstatsslot() calls with flags=0, while retaining the separate MCV flags for possible future extensions #6.
- Richard Guo requested documentation of the zero-flags behavior and questioned whether security checks should move into the pre-check #7; Tom kept those checks in place to preserve flexibility and avoid optimizing an unimportant failure case #8, and David incorporated the documentation request into the revised patch #9.
- Tomas reviewed the revision favorably, suggested a named constant for zero, and explained why ordinary regression tests could not observe the optimization #10; Tom agreed that coverage was sufficient #11, and David submitted ATTSTATSSLOT_EXISTS without a dedicated test #12.
- Tom committed the final revision with light edits as f84ff0c6d4, retaining literal zero instead of ATTSTATSSLOT_EXISTS and rewriting the API comment to explain that no matching free_attstatsslot() call is required; his closing message confirms the optimization landed and explains why a zero-valued named constant was unsuitable for the bitmask API #13.