]> granicus.if.org Git - postgresql/commit
Use atomic ops to hand out pages to scan in parallel scan.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 16 Aug 2017 13:18:41 +0000 (16:18 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 16 Aug 2017 13:18:41 +0000 (16:18 +0300)
commit3cda10f41bfed7e34b0db7013b66dd40a5f75926
tree4ff54d4f5050da1b2b5b58dc277716b93f21d9be
parent0c504a80cf2e6f66df2cdea563e879bf4abd1629
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
src/backend/access/heap/heapam.c
src/include/access/relscan.h