Skip site navigation (1) Skip section navigation (2)

pgsql: Move "hot" members of PGPROC into a separate PGXACT array.

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Move "hot" members of PGPROC into a separate PGXACT array.
Date: 2011-11-25 13:19:14
Message-ID: E1RTvgQ-0004Do-3l@gemulon.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Move "hot" members of PGPROC into a separate PGXACT array.

This speeds up snapshot-taking and reduces ProcArrayLock contention.
Also, the PGPROC (and PGXACT) structures used by two-phase commit are
now allocated as part of the main array, rather than in a separate
array, and we keep ProcArray sorted in pointer order.  These changes
are intended to minimize the number of cache lines that must be pulled
in to take a snapshot, and testing shows a substantial increase in
performance on both read and write workloads at high concurrencies.

Pavan Deolasee, Heikki Linnakangas, Robert Haas

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/ed0b409d22346b1b027a4c2099ca66984d94b6dd

Modified Files
--------------
src/backend/access/transam/twophase.c |  115 ++++++++------
src/backend/access/transam/varsup.c   |   11 +-
src/backend/access/transam/xact.c     |    4 +-
src/backend/commands/analyze.c        |    4 +-
src/backend/commands/vacuum.c         |    4 +-
src/backend/postmaster/postmaster.c   |    3 +
src/backend/replication/walsender.c   |    2 +-
src/backend/storage/ipc/ipci.c        |    2 +-
src/backend/storage/ipc/procarray.c   |  276 ++++++++++++++++++++-------------
src/backend/storage/lmgr/deadlock.c   |    4 +-
src/backend/storage/lmgr/lock.c       |    3 +-
src/backend/storage/lmgr/proc.c       |   87 ++++++++---
src/backend/utils/time/snapmgr.c      |    2 +-
src/include/storage/proc.h            |   47 ++++--
14 files changed, 356 insertions(+), 208 deletions(-)

pgsql-committers by date

Next:From: Dean RasheedDate: 2011-11-25 16:16:29
Subject: Re: [COMMITTERS] pgsql: Enable CHECK constraints to be declared NOT VALID
Previous:From: Tom LaneDate: 2011-11-25 04:21:57
Subject: pgsql: Fix unsupported options in CREATE TABLE ... AS EXECUTE.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group