model-writtenrun 6185 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Nov 2020 - Jun 2021 · 23 entries
- Tomas Vondra opened with a proof of concept supporting expressions in extended-statistics definitions and multivariate estimates, while acknowledging incomplete functional-dependency estimates and missing per-expression statistics #1.
- Tomas proposed storing per-expression pg_statistic rows inside pg_statistic_ext_data, then implemented that composite-array storage and planner lookup so expression statistics could provide index-like estimation benefits without maintaining an index #2 #3.
- Justin Pryzby supplied bootstrap prerequisites, bug fixes and a proposed view extension; Tomas integrated selected fixes but chose a separate pg_stats_ext_exprs view instead of embedding nested expression statistics in pg_stats_ext #4 #6.
- Justin raised parenthesized-column and system-attribute inconsistencies early, while Tomas explicitly deferred statistics predicates as a separate substantial project #7 #8.
- Dean Rasheed proposed distinct single-expression and multivariate forms of CREATE STATISTICS, with expression statistics built automatically; Tomas adopted this design and retained the expressions kind only internally, leaving deduplication across overlapping statistics objects for possible future work #10 #13 #15.
- Dean's January review found cloning, locking, dumping, display and relation-number problems, which Tomas addressed in the next revision; the same review exposed the pre-existing ability to create statistics on system catalogs #16 #22 #23.
- The system-catalog prohibition was extracted from #23 and committed independently with adapted regression tests as c9a0dc3486.
- Further January revisions added expression ACL checks and improved memory handling, fixed Justin's corrupt-ndistinct example, and addressed cleanup comments from Justin and Zhihong Yu; the immutability restriction was also removed #26 #27 #28 #29 #37.
- Dean challenged the wasteful use of expression identifiers above MaxHeapAttributeNumber and proposed negative identifiers, with separate remapping when combining functional dependencies #34 #36.
- Dean then supplied a substantive rewrite fixing the expression-view cross join and empty-table crash while unifying clause matching for combinations of ordinary columns and expressions #45.
- After a gap, Tomas incorporated Dean's rewrite, experimented with negative expression identifiers, and introduced shared build data for column and expression values; the consolidated series retained bitmapsets and added dependency and ndistinct fixes with broader tests #47 #48 #52.
- Justin separately refreshed the bootstrap prerequisites to address Dean's naming and cleanup concerns, and Tomas included those versions in the consolidated series #49 #52.
- Dean tested overlapping GROUP BY statistics and discussed the resulting estimates with Tomas; they accepted the current approach and deferred more sophisticated combination of overlapping statistics #53 #57 #58 #59 #60.
- The bootstrap prerequisites from #52 landed as e1a5e65703 and 79f6a942bd, retaining Justin's list conversion but refining naming and allowing repeated reloads; Tomas then posted the remaining feature with ACL and presentation cleanup #61.
- Justin's sqlsmith testing exposed a PlaceHolderVar assertion failure and incorrect handling of joins in CREATE STATISTICS, while Dean supplied missing catalog documentation and clearer univariate/multivariate descriptions #63 #65 #66 #67.
- Investigation of the assertion led Tomas to simplify ndistinct estimation instead of preserving redundant expression bookkeeping; he also discovered that column type changes required rebuilding statistics definitions, with Dean supporting recreation without automatic ANALYZE #76 #79 #80.
- The next revisions fixed the JoinExpr cast, corrected whole-table dependencies for whole-row expressions, consolidated the type-change handling and reduced regression-test runtime #78 #81 #82.
- The reductions affecting existing tests were extracted from #82 and committed first as 98376c18f1, keeping their changed estimates separate from the new feature.
- After Dean's final review, Tomas committed the feature and remaining test changes from #82 as a4d75c86bf, adding comment preservation during type changes, relocating StatisticsGetRelation() and completing psql expression display #83 #85.
- Tomas's own buildfarm machine immediately exposed locale-dependent test expressions; 2a058e938c replaced string concatenation with upper() to stabilize the tests #86.
- Post-landing discussion included a proposed maintenance-documentation reference and renewed reports that older psql clients omit expression information when describing newer servers, without an implemented compatibility solution in this thread #87 #88.
- Noah Misch found that the new transformed flag was missing from node copy, equality and output functions; Tomas fixed that directly from the report in d57ecebd12 #89 #90.
- Tom Lane and Tomas examined why existing parse-tree checks missed the omitted field, and Noah subsequently aligned the structure's field order with the node functions in 13a1ca160d, also explaining that the preceding fix had not required a catalog-version bump #91 #92 #93 #94.
Aug - Sep 2021 · 4 entries
- In August, Justin revived the unresolved extra-parentheses and parenthesized-column issues; Tomas posted two fixes, and Justin corrected a misplaced pg_dump test change and endorsed both patches despite the effect on dumping redundant beta-era statistics objects #96 #97 #99 #100 #102.
- Those two fixes from #99 landed as 13380e1476 and 537ca68dbb, with the pg_dump expectation assigned to the parentheses fix and explanatory comments expanded for column recognition #103.
- While finishing column recognition, Tomas added a separate check for system attributes hidden inside expressions; Justin supported it, and the attached patch landed unchanged as c9eeef2a15 #103 #106 #107.
- The thread ended with the feature and its submitted follow-up fixes committed; Tomas declined to prohibit expressions without column references because volatile expressions such as random() could still be useful #107.