-
Notifications
You must be signed in to change notification settings - Fork 2
Comparing changes
Open a pull request
base repository: postgresql-cfbot/postgresql
base: cf/6023~1
head repository: postgresql-cfbot/postgresql
compare: cf/6023
- 8 commits
- 29 files changed
- 2 contributors
Commits on Dec 25, 2025
-
Instrumentation: Keep time fields as instrtime, require caller to con…
…vert Previously the Instrumentation logic always converted to seconds, only for many of the callers to do unnecessary division to get to milliseconds. Since an upcoming refactoring will split the Instrumentation struct, utilize instrtime always to keep things simpler.
Configuration menu - View commit details
-
Copy full SHA for 46f95d6 - Browse repository at this point
Copy the full SHA 46f95d6View commit details -
Separate node and trigger instrumentation from other use of Instrumen…
…tation struct Previously different places (e.g. query "total time") were repurposing the Instrumentation struct initially introduced for capturing per-node statistics during execution. This overuse of the same struct is confusing, e.g. by cluttering calls of InstrStartNode/InstrStopNode in unrelated code paths, and prevents future refactorings. Instead, simplify the Instrumentation struct to only track time and WAL/buffer usage. Similarly, drop the use of InstrEndLoop outside of per-node instrumentation - these calls were added without any apparent benefit since the relevant fields were never read. Introduce the NodeInstrumentation struct to carry forward the per-node instrumentation information, and introduce TriggerInstrumentation to capture trigger timing and firings (previously counted in "ntuples").
Configuration menu - View commit details
-
Copy full SHA for a5cb86c - Browse repository at this point
Copy the full SHA a5cb86cView commit details -
Replace direct changes of pgBufferUsage/pgWalUsage with INSTR_* macros
This encapsulates the ownership of these globals better, and will allow a subsequent refactoring.
Configuration menu - View commit details
-
Copy full SHA for dc918a0 - Browse repository at this point
Copy the full SHA dc918a0View commit details -
Optimize measuring WAL/buffer usage through stack-based instrumentation
Previously, in order to determine the buffer/WAL usage of a given code section, we utilized continuously incrementing global counters that get updated when the actual activity (e.g. shared block read) occurred, and then calculated a diff when the code section ended. This resulted in a bottleneck for executor node instrumentation specifically, with the function BufferUsageAccumDiff showing up in profiles and in some cases adding up to 10% overhead to an EXPLAIN (ANALYZE, BUFFERS) run. Instead, introduce a stack-based mechanism, where the actual activity writes into the current stack entry. In the case of executor nodes, this means that each node gets its own stack entry that is pushed at InstrStartNode, and popped at InstrEndNode. Stack entries are zero initialized (avoiding the diff mechanism) and get added to their parent entry when they are finalized, i.e. no more modifications can occur. To correctly handle abort situations, any use of instrumentation stacks must involve either a top-level Instrumentation struct, and its associated InstrStart/ InstrStop helpers (which use resource owners to handle aborts), or dedicated PG_TRY/PG_FINALLY calls that ensure the stack is in a consistent state after an abort.
Configuration menu - View commit details
-
Copy full SHA for 4fecc84 - Browse repository at this point
Copy the full SHA 4fecc84View commit details -
Configuration menu - View commit details
-
Copy full SHA for 050ea03 - Browse repository at this point
Copy the full SHA 050ea03View commit details -
Convert remaining users of pgBufferUsage to use InstrStart/InstrStop,…
… drop the global
Configuration menu - View commit details
-
Copy full SHA for 6189c02 - Browse repository at this point
Copy the full SHA 6189c02View commit details -
Index scans: Split heap and index buffer access reporting in EXPLAIN
This makes it clear whether activity was on the index directly, or on the table based on heap fetches.
Configuration menu - View commit details
-
Copy full SHA for 8d93481 - Browse repository at this point
Copy the full SHA 8d93481View commit details -
[CF 6023] v4 - Stack-based tracking of per-node WAL/buffer usage
This branch was automatically generated by a robot using patches from an email thread registered at: https://commitfest.postgresql.org/patch/6023 The branch will be overwritten each time a new patch version is posted to the thread, and also periodically to check for bitrot caused by changes on the master branch. Patch(es): https://www.postgresql.org/message-id/CAP53PkzZ3UotnRrrnXWAv=F4avRq9MQ8zU+bxoN9tpovEu6fGQ@mail.gmail.com Author(s): Lukas Fittl
Commitfest Bot committedDec 25, 2025 Configuration menu - View commit details
-
Copy full SHA for 2701adb - Browse repository at this point
Copy the full SHA 2701adbView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff cf/6023~1...cf/6023