Add wait events for COPY file/program operations #11
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.
Summary
COPY operations previously showed
wait_event = NULLwhen blocking on file/program I/O, making it impossible to diagnose performance issues during data loading, ETL operations, or pg_dump/pg_restore.This patch adds two new IO wait events:
COPY_DATA_READ: When COPY FROM blocks reading from file or programCOPY_DATA_WRITE: When COPY TO blocks writing to file or programCoverage
Note: STDIN/STDOUT already have coverage via
Client/ClientReadandClient/ClientWriteevents at the protocol layer.Use Cases
Changes
src/backend/commands/copyfromparse.c: Wrapfread()with wait eventssrc/backend/commands/copyto.c: Wrapfwrite()with wait eventssrc/backend/utils/activity/wait_event_names.txt: Add event definitions