IO wait events for COPY FROM/TO PROGRAM or file
Nikolay Samokhvalov <nik@postgres.ai>
From: Nikolay Samokhvalov <nik@postgres.ai>
To: pgsql-hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-01-08T21:53:17Z
Lists: pgsql-hackers
Attachments
- v1-0001-Add-IO-wait-events-for-COPY-file-program-operations.patch (application/octet-stream) patch v1-0001
Hi hackers, Following up on the discussion about wait event coverage for COPY operations [1], here's a tiny patch that adds two new IO wait events: - COPY_DATA_READ: COPY FROM blocking on file/program read - COPY_DATA_WRITE: COPY TO blocking on file/program write This enables diagnosing for cases like: - storage I/O bottlenecks during bulk loads slow exports to files (COPY FROM/TO '/path/to/file') - pipe buffer congestion in ETL pipelines (COPY FROM/TO PROGRAM) Note: as it turned out, COPY FROM/TO STDIN/STDOUT already have coverage via Client/ClientRead and Client/ClientWrite at the protocol layer (thus, pg_dump/pg_restore are already covered). So only file/program cases needed instrumentation. [1] https://www.postgresql.org/message-id/flat/CAM527d9PkaSj-gNjLZqjJXnqaWTD8kHPtm2Yj8-1Gh_0pTRgDA%40mail.gmail.com Nikx
Commits
-
Add two IO wait events for COPY FROM/TO on a pipe/file/program
- e05a24c2d4ea 19 (unreleased) landed