Use atomic ops to hand out pages to scan in parallel scan.
Heikki Linnakangas <heikki.linnakangas@iki.fi>
Use atomic ops to hand out pages to scan in parallel scan. With a lot of CPUs, the spinlock that protects the current scan location in a parallel scan can become a bottleneck. Use an atomic fetch-and-add instruction instead. David Rowley Discussion: https://www.postgresql.org/message-id/CAKJS1f9tgsPhqBcoPjv9_KUPZvTLCZ4jy%3DB%3DbhqgaKn7cYzm-w@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/heap/heapam.c | modified | +59 −43 |
| src/include/access/relscan.h | modified | +3 −2 |
Discussion
- Atomics for heap_parallelscan_nextpage() 32 messages · 2017-05-06 → 2017-08-17