Avoid useless buffer allocations during binary COPY FROM.
Tom Lane <tgl@sss.pgh.pa.us>
Avoid useless buffer allocations during binary COPY FROM. The raw_buf and line_buf buffers aren't used when reading binary format, so skip allocating them. raw_buf is 64K so that seems like a worthwhile savings. An unused line_buf only wastes 1K, but as long as we're checking it's free to avoid allocating that too. Bharath Rupireddy, tweaked a bit by me Discussion: https://postgr.es/m/CALj2ACXcCKaGPY0whowqrJ4OPJvDnTssgpGCzvuFQu5z0CXb-g@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/commands/copy.c | modified | +15 −5 |
Discussion
- [PATCH] Remove Extra palloc Of raw_buf For Binary Format In COPY FROM 10 messages · 2020-06-26 → 2020-07-18