postgresql/src/backend
Simon Riggs 9b013dc238 Improve performance of replay of AccessExclusiveLocks
A hot standby replica keeps a list of Access Exclusive locks for a top
level transaction. These locks are released when the top level transaction
ends. Searching of this list is O(N^2), and each transaction had to pay the
price of searching this list for locks, even if it didn't take any AE
locks itself.

This patch optimizes this case by having the master server track which
transactions took AE locks, and passes that along to the standby server in
the commit/abort record. This allows the standby to only try to release
locks for transactions which actually took any, avoiding the majority of
the performance issue.

Refactor MyXactAccessedTempRel into MyXactFlags to allow minimal additional
cruft with this.

Analysis and initial patch by David Rowley
Author: David Rowley and Simon Riggs
2017-03-22 13:09:36 +00:00
..
access Improve performance of replay of AccessExclusiveLocks 2017-03-22 13:09:36 +00:00
bootstrap Move atooid() definition to a central place 2017-03-01 11:55:28 -05:00
catalog Add pg_ls_logdir() and pg_ls_waldir() functions. 2017-03-16 15:05:02 -04:00
commands Improve performance of replay of AccessExclusiveLocks 2017-03-22 13:09:36 +00:00
executor Don't scan partitioned tables. 2017-03-21 09:48:04 -04:00
foreign Spelling fixes in code comments 2017-03-14 12:58:39 -04:00
lib Fix overflow check in StringInfo; add missing casts 2017-01-10 11:41:13 -03:00
libpq Allow plaintext 'password' authentication when user has a SCRAM verifier. 2017-03-17 11:33:27 +02:00
main Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
nodes Don't scan partitioned tables. 2017-03-21 09:48:04 -04:00
optimizer Don't scan partitioned tables. 2017-03-21 09:48:04 -04:00
parser Add IF NOT EXISTS for CREATE SERVER and CREATE USER MAPPING 2017-03-20 16:40:45 -04:00
po Translation updates 2016-08-08 11:08:00 -04:00
port Fix WaitEventSetWait() to handle write-ready waits properly on Windows. 2017-03-17 14:58:06 -04:00
postmaster Fix REFRESH MATERIALIZED VIEW to report activity to the stats collector. 2017-03-18 17:49:39 -04:00
regex Spelling fixes in code comments 2017-03-14 12:58:39 -04:00
replication Teach xlogreader to follow timeline switches 2017-03-22 07:05:12 +00:00
rewrite Support XMLTABLE query expression 2017-03-08 12:40:26 -03:00
snowball Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
storage Improve performance of replay of AccessExclusiveLocks 2017-03-22 13:09:36 +00:00
tcop Disallow CREATE/DROP SUBSCRIPTION in transaction block 2017-03-03 23:29:13 -05:00
tsearch Spelling fixes in code comments 2017-03-14 12:58:39 -04:00
utils Don't scan partitioned tables. 2017-03-21 09:48:04 -04:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove maintainer-check target, fold into normal build 2013-10-10 20:11:56 -04:00
Makefile Fix parallel make issue with new fmgrprotos.h 2017-01-23 15:36:27 -05:00
nls.mk Remove trailing slashes from directories in find command 2015-09-18 22:06:54 -04:00