pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Add a small cache of locks owned by a resource owner in Resource 3+ messages / 2 participants [nested] [flat]
* pgsql: Add a small cache of locks owned by a resource owner in Resource @ 2012-06-21 12:30 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 3+ messages in thread From: Heikki Linnakangas @ 2012-06-21 12:30 UTC (permalink / raw) To: pgsql-committers Add a small cache of locks owned by a resource owner in ResourceOwner. This speeds up reassigning locks to the parent owner, when the transaction holds a lot of locks, but only a few of them belong to the current resource owner. This is particularly helps pg_dump when dumping a large number of objects. The cache can hold up to 15 locks in each resource owner. After that, the cache is marked as overflowed, and we fall back to the old method of scanning the whole local lock table. The tradeoff here is that the cache has to be scanned whenever a lock is released, so if the cache is too large, lock release becomes more expensive. 15 seems enough to cover pg_dump, and doesn't have much impact on lock release. Jeff Janes, reviewed by Amit Kapila and Heikki Linnakangas. Branch ------ master Details ------- http://git.postgresql.org/pg/commitdiff/eeb6f37d89fc60c6449ca12ef9e91491069369cb Modified Files -------------- src/backend/storage/lmgr/lock.c | 154 ++++++++++++++++++++++----------- src/backend/utils/resowner/resowner.c | 95 ++++++++++++++++++++- src/include/storage/lock.h | 4 +- src/include/utils/resowner.h | 5 + 4 files changed, 205 insertions(+), 53 deletions(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Add a small cache of locks owned by a resource owner in Resource @ 2015-08-27 16:22 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2015-08-27 16:22 UTC (permalink / raw) To: pgsql-committers Add a small cache of locks owned by a resource owner in ResourceOwner. Back-patch 9.3-era commit eeb6f37d89fc60c6449ca12ef9e91491069369cb, to improve the older branches' ability to cope with pg_dump dumping a large number of tables. I back-patched into 9.2 and 9.1, but not 9.0 as it would have required a significant amount of refactoring, thus negating the argument that this is by-now-well-tested code. Jeff Janes, reviewed by Amit Kapila and Heikki Linnakangas. Branch ------ REL9_2_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/0e933fdf9463857d4788e2e638affdde865855ce Modified Files -------------- src/backend/storage/lmgr/lock.c | 152 ++++++++++++++++++++++----------- src/backend/utils/resowner/resowner.c | 95 ++++++++++++++++++++- src/include/storage/lock.h | 4 +- src/include/utils/resowner.h | 5 ++ 4 files changed, 204 insertions(+), 52 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Add a small cache of locks owned by a resource owner in Resource @ 2015-08-27 16:22 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2015-08-27 16:22 UTC (permalink / raw) To: pgsql-committers Add a small cache of locks owned by a resource owner in ResourceOwner. Back-patch 9.3-era commit eeb6f37d89fc60c6449ca12ef9e91491069369cb, to improve the older branches' ability to cope with pg_dump dumping a large number of tables. I back-patched into 9.2 and 9.1, but not 9.0 as it would have required a significant amount of refactoring, thus negating the argument that this is by-now-well-tested code. Jeff Janes, reviewed by Amit Kapila and Heikki Linnakangas. Branch ------ REL9_1_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/9b1b9446f563c85d1fe6bb8fca91a2608f3b9577 Modified Files -------------- src/backend/storage/lmgr/lock.c | 150 ++++++++++++++++++++++----------- src/backend/utils/resowner/resowner.c | 95 ++++++++++++++++++++- src/include/storage/lock.h | 4 +- src/include/utils/resowner.h | 5 ++ 4 files changed, 202 insertions(+), 52 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2015-08-27 16:22 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2012-06-21 12:30 pgsql: Add a small cache of locks owned by a resource owner in Resource Heikki Linnakangas <heikki.linnakangas@iki.fi> 2015-08-27 16:22 pgsql: Add a small cache of locks owned by a resource owner in Resource Tom Lane <tgl@sss.pgh.pa.us> 2015-08-27 16:22 pgsql: Add a small cache of locks owned by a resource owner in Resource Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox