IO wait events for COPY FROM/TO PROGRAM or file - Mailing list pgsql-hackers

From Nikolay Samokhvalov
Subject IO wait events for COPY FROM/TO PROGRAM or file
Date
Msg-id CAM527d_iDzz0Kqyi7HOfqa-Xzuq29jkR6AGXqfXLqA5PR5qsng@mail.gmail.com
Whole thread Raw
Responses Re: IO wait events for COPY FROM/TO PROGRAM or file
List pgsql-hackers
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.


Nikx
Attachment

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: pg_plan_advice
Next
From: Masahiko Sawada
Date:
Subject: Re: POC: enable logical decoding when wal_level = 'replica' without a server restart