model-writtenrun 1107 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Sami Imseih proposed moving query normalization and its helpers from pg_stat_statements into core so extensions could share the implementation, alongside making JumbleState read-only in the post_parse_analyze hook #1.
- Bertrand Drouvot pointed out that adding const still allowed the length helper to mutate the pointed-to location array #2, prompting Sami to replace the const proposal with a normalization callback stored in JumbleState #3.
- Michael Paquier argued for reusable public APIs and protecting shared state #4; Sami then removed the callback in favor of a directly exported GenerateNormalizedQuery(), leaving broader jumbling APIs for separate work #5 #7.
- Sami and Michael rejected zengman's suggestion to replace length assertions with conditional copying because it could hide incorrect calculations, while zengman otherwise said the revised patch looked good #6 #7 #8 #10.
- Michael explained that moving mutating code into core did not protect shared JumbleState data and proposed computing lengths in a separate copy #10; Lukas Fittl supported a stronger read-only contract, while Sami argued that normalization should remain on demand to avoid unnecessary overhead #12 #16.
- Sami restored the const-hook patch with a temporary copy of the location array and removed an unnecessary cast identified by Bertrand, establishing the implementation that would underpin the final change #14 #17.
- After a gap, Sami rebased the series in March #19, then incorporated Lukas's review fixes for allocation, stale scanner initialization, and comments #20 #21.
- Lukas tested adaptations of pg_stat_monitor and pg_tracing and proposed exporting the length helper for extracting inline parameter values #22; Sami renamed and exported ComputeConstantLengths(), and Lukas reported a successful follow-up pg_tracing test #23 #24.
- Michael supplied a smaller patch retaining only const protection and private length computation in pg_stat_statements, arguing that core should not prescribe normalized-query formatting #25.
- Lukas and Sami proposed a compromise that exported only ComputeConstantLengths(), explaining that constant lengths were useful independently of formatting and that some lengths were already recorded during jumbling; Michael accepted that direction for the release #26 #27 #29 #30 #31.
- Lukas assembled the compromise from Sami's earlier series and reported passing regression tests for adapted pg_stat_monitor and pg_tracing, while noting a pg_tracing-specific leading-comment behavior that its maintainers would need to consider #33.
- After Michael and Sami endorsed the final patch #34 #35, Michael committed it as 49cc0d4148, restoring comments lost during extraction and adjusting wording without changing the submitted logic #36.
- The thread ended with acknowledgments from Lukas and Sami: the const hook and shared constant-length helper had landed, while moving query-string normalization into core was left out of the agreed scope #37 #38 #25 #33.