PG-2623 Utility statement normalization - #830
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #830 +/- ##
==========================================
- Coverage 88.68% 88.41% -0.27%
==========================================
Files 3 3
Lines 1317 1321 +4
Branches 186 193 +7
==========================================
Hits 1168 1168
- Misses 75 77 +2
- Partials 74 76 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
artemgavrilov
force-pushed
the
PG-2623-utility-statement-normalization
branch
2 times, most recently
from
August 19, 2026 13:46
bab1472 to
175c83b
Compare
artemgavrilov
marked this pull request as ready for review
August 19, 2026 13:54
artemgavrilov
force-pushed
the
PG-2623-utility-statement-normalization
branch
from
August 19, 2026 21:44
175c83b to
3e478c6
Compare
jeltz
requested changes
Aug 20, 2026
artemgavrilov
force-pushed
the
PG-2623-utility-statement-normalization
branch
from
August 21, 2026 14:26
3e478c6 to
6dfd3ab
Compare
Split pgsm_get_query_stats() into an explicit lookup and create entry functions.
Crete query stats entry for utility statements in pgsm_post_parse_analyze hook, where we have normalized query text. Because utility statement execution may tirgger memory context cleanup we have to copy entry found in the list to the stack. This change brings parity with pg_stat_statements regarding utitliy statements.
After recent changes there is no more reasons to have two distinct functions instead of one.
artemgavrilov
force-pushed
the
PG-2623-utility-statement-normalization
branch
from
August 24, 2026 13:35
6dfd3ab to
fe1c329
Compare
jeltz
approved these changes
Aug 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PG-2623
Description
To have normalized query text for utility statements we have to pre-save it in post parse hook. (pretty much the same as for ordinary queries). Because some utility statements may cleanup our memory context we have to copy query stats entry to stack.
Links