pg_stat_statements: Add gc_count and query_file_size to pgss_info#35
Open
lfittl wants to merge 1 commit into
Open
pg_stat_statements: Add gc_count and query_file_size to pgss_info#35lfittl wants to merge 1 commit into
lfittl wants to merge 1 commit into
Conversation
This surfaces two internal metrics to end-users and monitoring scripts
that allow using pg_stat_statements more effectively:
The "gc_count" field complements the existing deallocation counter
("dealloc"), but counts up when the actual query text garbage collection
occurrs, which is when the pg_stat_statements LWLock is typically held
the longest, and significant I/O can occur for large query text files.
The "query_file_size" field returns the current size of the query text
file, as tracked by pg_stat_statements already, without requiring a stat()
call. This can be useful for automated collection of query texts, to
tweak how often to collect them, based on the query file size. It also
helps correlate the amount of I/O performed with the actual file size,
which can be up to 2x of the sum of the query texts actually returned.
Bump pg_stat_statements version to 1.14 due to the addition of the two
new columns to pg_stat_statements_info.
Author: Lukas Fittl <lukas@fittl.com>
Reviewed by:
Discussion:
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.
This surfaces two internal metrics to end-users and monitoring scripts that allow using pg_stat_statements more effectively:
The "gc_count" field complements the existing deallocation counter ("dealloc"), but counts up when the actual query text garbage collection occurrs, which is when the pg_stat_statements LWLock is typically held the longest, and significant I/O can occur for large query text files.
The "query_file_size" field returns the current size of the query text file, as tracked by pg_stat_statements already, without requiring a stat() call. This can be useful for automated collection of query texts, to tweak how often to collect them, based on the query file size. It also helps correlate the amount of I/O performed with the actual file size, which can be up to 2x of the sum of the query texts actually returned.
Bump pg_stat_statements version to 1.14 due to the addition of the two new columns to pg_stat_statements_info.