Replace pq_getbytes(&ch, 1) calls with pq_getbyte(), which is easier
Tom Lane <tgl@sss.pgh.pa.us>
Replace pq_getbytes(&ch, 1) calls with pq_getbyte(), which is easier to use and significantly faster. This tweak saves 25% (!) of the runtime of COPY IN in a test with 8000-character lines. I wouldn't normally commit a performance improvement this late in the cycle, but 25% got my attention...
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/commands/copy.c | modified | +5 −11 |
| src/backend/libpq/pqcomm.c | modified | +3 −2 |
| src/backend/tcop/postgres.c | modified | +10 −11 |
| src/include/libpq/libpq.h | modified | +2 −1 |