Improve bulk-insert performance by keeping the current target buffer pinned
Tom Lane <tgl@sss.pgh.pa.us>
Improve bulk-insert performance by keeping the current target buffer pinned (but not locked, as that would risk deadlocks). Also, make it work in a small ring of buffers to avoid having bulk inserts trash the whole buffer arena. Robert Haas, after an idea of Simon Riggs'.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/heap/heapam.c | modified | +48 −20 |
| src/backend/access/heap/hio.c | modified | +70 −19 |
| src/backend/access/heap/rewriteheap.c | modified | +4 −2 |
| src/backend/access/heap/tuptoaster.c | modified | +9 −14 |
| src/backend/commands/copy.c | modified | +11 −7 |
| src/backend/executor/execMain.c | modified | +16 −11 |
| src/backend/storage/buffer/freelist.c | modified | +4 −1 |
| src/backend/storage/buffer/README | modified | +5 −1 |
| src/include/access/heapam.h | modified | +11 −2 |
| src/include/access/hio.h | modified | +19 −2 |
| src/include/access/tuptoaster.h | modified | +2 −2 |
| src/include/storage/bufmgr.h | modified | +2 −1 |