]> granicus.if.org Git - postgresql/commit
Move RecoveryLockList into a hash table.
authorThomas Munro <tmunro@postgresql.org>
Tue, 26 Jun 2018 05:56:20 +0000 (17:56 +1200)
committerThomas Munro <tmunro@postgresql.org>
Tue, 26 Jun 2018 05:56:20 +0000 (17:56 +1200)
commit7bcda60d41cb920193e9d56a3b03583d7998c635
treeace89ddb3829c83f4cfda0272cf5da2dd64b3623
parent910e2aca129cf0cda759c57920141c044aa1a8ba
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
src/backend/storage/ipc/standby.c