pgsql: Move RecoveryLockList into a hash table.

From: Thomas Munro <tmunro(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Move RecoveryLockList into a hash table.
Date: 2018-06-26 07:12:28
Message-ID: E1fXi9M-0004y5-0b@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Move RecoveryLockList into a hash table.

Standbys frequently need to release all locks held by a given xid.
Instead of searching one big list linearly, let's create one list
per xid and put them in a hash table, so we can find what we need
in O(1) time.

Earlier analysis and a prototype were done by David Rowley, though
this isn't his patch.

Back-patch all the way.

Author: Thomas Munro
Diagnosed-by: David Rowley, Andres Freund
Reviewed-by: Andres Freund, Tom Lane, Robert Haas
Discussion: https://postgr.es/m/CAEepm%3D1mL0KiQ2KJ4yuPpLGX94a4Ns_W6TL4EGRouxWibu56pA%40mail.gmail.com
Discussion: https://postgr.es/m/CAKJS1f9vJ841HY%3DwonnLVbfkTWGYWdPN72VMxnArcGCjF3SywA%40mail.gmail.com

Branch
------
REL9_4_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/c4ccbcc1a2a17d547537ccecd9e856cb083c2ff7

Modified Files
--------------
src/backend/storage/ipc/standby.c | 165 ++++++++++++++++++++------------------
1 file changed, 88 insertions(+), 77 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Thomas Munro 2018-06-26 07:12:44 pgsql: Move RecoveryLockList into a hash table.
Previous Message Thomas Munro 2018-06-26 07:12:09 pgsql: Move RecoveryLockList into a hash table.