model-writtenrun 5095 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tom Lane proposed modernizing GUC infrastructure in #1 to remove scaling bottlenecks and improve support for existing applications using custom GUCs as session variables, while questioning whether the separate schema-variables proposal matched users' needs.
- The four-part series in #1 added memory-allocation prerequisites, moved GUC data into a dedicated memory context, replaced sorted-array lookup with dynahash, and introduced lists for nondefault variables, transaction stacks, and pending reports; Tom reported that creating 10,000 custom GUCs fell from about 4,700 milliseconds to 23 milliseconds, while the lists eliminated transaction-maintenance costs proportional to all registered variables.
- Andres Freund supported the infrastructure changes in #2, accepted the check-hook API migration, and suggested context-ownership assertions to make allocation mistakes easier to diagnose; he also proposed separating GUC definitions from machinery, which Tom treated as independent work in #3.
- Junwang Zhao questioned the hash-table allocation comment in #4, but Tom explained in #5 that allocating an extra quarter leaves one fifth of the total space spare, and Junwang accepted the explanation in #6.
- Pavel Stehule defended schema variables' persistent metadata, compound types, privileges, nullability, and defaults in #7 and #8, while Julien Rouhaud highlighted SQL integration and statement stability in #9; Tom clarified in #10 that the GUC improvements did not preclude schema variables and that the broader debate belonged elsewhere.
- The semantic disagreement continued: Pavel supported faster GUCs while distinguishing them from procedural variables in #12, Robert Haas argued for arbitrary SQL types in #13 and #16, and Tom maintained in #14 that nontransactional GUC access constrained their types; Pavel also described simplifications and Julien's review of the separate schema-variable work in #15.
- After rebasing the series in #17, Tom posted #18 with ownership assertions in guc_realloc() and guc_free(), reporting that deliberately omitted allocation conversions produced intelligible failures on Linux; the supplied thread ends with his request for further review.
- On October 14, Tom committed the memory-infrastructure component of #18 unchanged as 9c911ec065, adding repalloc_extended() and allowing dynahash's default allocator to honor HASH_ENTER_NULL.
- Tom then committed the dedicated GUC memory context and allocation-API migration from #18 unchanged as 407b50f2d4, including the diagnostic assertions for outdated extension code.
- The hash-table component of #18 landed unchanged as 3057465acf, making variable insertion cheaper and constructing sorted arrays only for display operations.
- The auxiliary-list component of #18 landed unchanged as f13b2088fa, completing all four submitted components and limiting frequent maintenance to relevant GUCs; the broader question of schema variables versus user-defined GUCs remained unresolved in the supplied discussion.