model-writtenrun 7586 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Dec 2017 - Apr 2018 · 16 entries
- Andrew Dunstan opened the thread with a revised implementation based on Serge Rielau's earlier work, storing an evaluated default in pg_attribute so existing rows could acquire nonvolatile defaults without a table rewrite, while volatile defaults still required rewriting #1.
- Tom Lane questioned the cost of changing fundamental tuple-access paths and argued that an incompatible heap_attisnull API was preferable to silently using an unsafe alternative; he also insisted that missing values were distinct from default expressions #2 #4.
- Andrew separated missing values into their own TupleConstr structure and completed datum comparisons in equalTupleDescs, while retaining the need for a constraint-preserving tuple-descriptor copy at one additional call site #7 #8.
- After catalog and API rebases, Andres Freund requested tuple-deformation benchmarks, and Tomas Vondra's testing exposed severe quadratic overhead, incorrect aggregate results, and loss of missing values during VACUUM FULL #12 #13 #390304.
- Andrew fixed tuple deformation and identity-column rewriting, corrected projection matching for aggregates, and replaced quadratic missing-value filling with linear processing; Tomas's subsequent benchmarks confirmed that the major performance regression was resolved #17 #20 #21 #22.
- David Rowley's detailed review identified unnecessary filling beyond requested attributes and several documentation and test-scheduling issues, which Andrew incorporated into the next full patch #25 #26.
- David supplied an experimental binary-search delta and demonstrated that the previous benchmark's last-column access favored the existing reverse search, while accessing an earlier column exposed additional overhead #30.
- Tom Lane and Andres Freund examined TOAST lifetime and locking risks, while Andres's broader code review called for typed storage, direct attribute-indexed missing-value arrays, and reduced work on hot tuple-access paths #37 #36 #45.
- Andrew changed stored missing values from bytea to one-element anyarray values and adopted direct indexing, superseding the binary-search experiment; he retained pg_attribute storage and support for stable expressions evaluated when the column is added #47.
- Andrew then added cleanup of missing-value metadata during table rewrites so materialized values would no longer require the extra metadata #49.
- David traced remaining excessive deformation to physical target lists and supplied a planner delta disabling that optimization for missing columns; benchmarks showed a substantial improvement, and Andrew incorporated the revised delta #50 #51 #52 #56.
- Further review found incorrect atthasmissing flags when defaults evaluated to NULL and redundant executor and slot-filling work, which Andrew addressed before reporting broadly comparable or improved benchmark results #54 #56 #57.
- David rebased the final full patch, verified that it built and passed regression tests, and supplied a final delta fixing missing flag initialization and polishing cleanup and documentation; Andrew accepted those changes for commitment #63 #64 #65.
- The fast-default feature landed as 16828d5c02, matching the cumulative full patch #63 and final delta #64 after rebasing.
- Post-commit review raised repeated copying of already-filled missing attributes, unnecessary tuple checks, and a possible slot-memory leak; Andrew proposed respecting tts_nvalid and agreed to several cleanups, but this thread supplies no attached follow-up implementation for those issues #67 #68 #71 #77.
- The 2018 discussion ended with unresolved disagreement about eager loading and catalog size: Andres favored loading missing values on demand, while Andrew explained that the tuple-access functions lacked a clean route to the catalog information needed to do so #76 #80.
Apr 2021 · 5 entries
- Three years later, Andrew Gierth revived the thread after diagnosing a crash caused by a missing pg_attrdef row and NULL adbin pointers; he also noticed that the fast-default patch had removed the warning about missing default records #81.
- Tom Lane proposed constructing only valid default arrays, reporting missing defaults when used, sorting arrays to eliminate quadratic comparisons, and simplifying inconsistent NULL handling #86.
- Andrew Dunstan questioned whether catalog inconsistencies should immediately raise errors, but Tom argued that failure during relcache loading would unnecessarily prevent reading or dumping the table; the revised patch applied warnings at load time and errors at use time to CHECK constraints as well #87 #91 #93.
- Tom declined Zhihong Yu's proposed counter renaming and array shrinking, explaining that unused slots did not constitute a memory leak, and retained the existing omission of constraint searches when relchecks is zero to avoid routine extra catalog work #88 #94 #93.
- The cleanup landed unchanged from #93 as 091e22b2e6; the final message confirmed the HEAD commit while leaving backpatching open, and the cause of the original catalog corruption remained undetermined #95 #96.