Track pg_stat_database temp_files and temp_bytes#818
Open
msepga wants to merge 1 commit into
Open
Conversation
We collect temp_files and temp_bytes from pg_stat_database as diffed counters, providing server-wide spill data to complement per-query temp_blks from pg_stat_statements.
lfittl
approved these changes
May 15, 2026
| int32 xact_rollback = 5; // Number of transactions in this database that have been rolled back | ||
| int64 untracked_cache_bytes = 6; // Size of Postgres buffer cache not associated with tables tracked by the collector | ||
| int32 temp_files = 7; // Number of temporary files created by queries in this database (diff) | ||
| int64 temp_bytes = 8; // Total data written to temporary files by queries in this database (diff) |
Member
There was a problem hiding this comment.
I'd drop the (diff) part of the comment since I think that's clear from the overall context (and other fields don't have it).
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.
We collect
temp_filesandtemp_bytesfrompg_stat_databaseas diffed counters, providing server-wide spill data to complement per-querytemp_blksfrompg_stat_statements.