model-writtenrun 2412 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- The thread began when ma lz asked why identical inserts into temporary tables received different query IDs across sessions; Michael Paquier explained that relation identity made this difficult to change without custom jumbling #1 #2.
- More than a year later, Christoph Berg revived the issue after a customer accumulated roughly 160,000 query IDs in several hours, submitting a customer-derived patch with regression tests that hashed temporary-table names instead of OIDs and reporting no measured performance loss #3.
- Michael requested an explicit pg_temp hash prefix and clearer documentation, which Christoph incorporated across two revisions while retaining the field annotations as documentation for the custom whole-node implementation #4 #5 #6 #7.
- Michael then replaced the whole-node implementation with field-level custom_query_jumble support and a separate RangeTblEntry.relid customization, avoiding duplicated maintenance of the large node structure; Christoph endorsed the design and helped clarify its documentation #8 #9 #11 #12.
- Tom Lane objected to catalog lookups during query-ID computation and to treating temporary tables differently, proposing relation aliases for all tables; his experiment showed that hashing the entire eref would also hash column names and undesirably split entries after ALTER TABLE, so a custom aliasname-only function was still needed #14 #15.
- Michael questioned losing schema identity, but Tom argued that broader aggregation was desirable; Michael implemented alias-based jumbling without relid and added tests covering temporary tables, schemas, and differing table definitions #16 #17 #18.
- Christoph found an obsolete include and a duplicated schema name in the tests, while Sami Imseih warned that merging queries across schemas would disrupt existing monitoring; Tom explained that distinct table aliases could preserve separate entries #19 #20 #21.
- Sami suggested a configuration switch, but Tom opposed configurable jumbling semantics and Michael chose to proceed without one; Sami subsequently reported fewer distinct query IDs in repeated regression runs, and Lukas Fittl supported the change for schema-per-customer workloads #22 #23 #26 #28 #33.
- Michael committed the field-level infrastructure from #18 with comment and formatting edits as 5ac462e2b7, then posted the remaining relation-name patch with Christoph's corrections and additional alias tests #34.
- Christoph approved the remaining patch, and Sami identified documentation that incorrectly promised different query IDs after recreating a table, suggesting function-based examples and an explanation of table aliases instead #36 #37.
- Michael extracted the tests from #34 into 3430215fe3, adjusting expected results to capture the existing behavior, then posted the remaining implementation with Sami's documentation changes #38.
- Tom discovered that the committed generator failed to honor query_jumble_ignore alongside custom_query_jumble and had a misplaced comment; Michael fixed both directly as 27ee6ede6b and incorporated Tom's separate wording corrections into the final feature patch #39 #40.
- After Sami approved the final patch and Michael compared pg_stat_statements dumps again, #40 landed unchanged as 787514b30b, completing the submitted work #41 #42.
- In July, Alexander Kukushkin reported that explicitly schema-qualified queries against very different tables now merged; Michael reiterated the distinct-alias workaround, but Alexander explained that many customers cannot change application queries #43 #44 #45.
- The thread ends with all four commits landed and no attached follow-up fix or revert: Lukas defended aggregation as necessary for large multi-tenant workloads and suggested logs or auto_explain for schema-specific investigation, leaving Alexander's monitoring concerns unresolved #46.