model-writtenrun 668 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Richard Guo proposed preserving base-table distinct counts for GROUP BY and DISTINCT keys while stripping frequency-dependent statistics in #1, reporting corrected cardinality estimates, hash joins, and a roughly 1300-fold improvement on TPC-DS query 31.
- wenhui qiu questioned negative-stadistinct conversion for nested subqueries and proposed using vardata->rel in #2, but Richard explained in #3 that this would use the outer scan's row count instead of the underlying table's, so the proposed replacement was not adopted.
- wenhui qiu accepted that explanation and declared the patch LGTM in #4.
- After self-review, Richard supplied #5 to adjust stanullfrac as well: qualifying single-key cases use 1/(ndistinct+1), while other cases approximate the fraction as zero, retaining the original approach and regression tests.
- Richard committed #5 unchanged as 906b1e4a19 and confirmed the push in #6, leaving the submitted work fully landed.