pgsql: Use atomic ops to hand out pages to scan in parallel scan.

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Use atomic ops to hand out pages to scan in parallel scan.
Date: 2017-08-16 13:19:41
Message-ID: E1dhyEX-0002H9-Ku@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3cda10f41bfed7e34b0db7013b66dd40a5f75926

Modified Files
--------------
src/backend/access/heap/heapam.c | 102 ++++++++++++++++++++++-----------------
src/include/access/relscan.h | 5 +-
2 files changed, 62 insertions(+), 45 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2017-08-16 14:04:43 Re: pgsql: Remove dedicated B-tree root-split record types.
Previous Message Michael Meskes 2017-08-16 11:30:37 pgsql: Changed ecpg parser to allow RETURNING clauses without attached