pgsql: Move isolationtester's is-blocked query into C code for speed.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Move isolationtester's is-blocked query into C code for speed.
Date: 2017-04-10 14:27:04
Message-ID: E1cxaHY-0001SU-T5@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Move isolationtester's is-blocked query into C code for speed.

Commit 4deb41381 modified isolationtester's query to see whether a
session is blocked to also check for waits occurring in GetSafeSnapshot.
However, it did that in a way that enormously increased the query's
runtime under CLOBBER_CACHE_ALWAYS, causing the buildfarm members
that use that to run about four times slower than before, and in some
cases fail entirely. To fix, push the entire logic into a dedicated
backend function. This should actually reduce the CLOBBER_CACHE_ALWAYS
runtime from what it was previously, though I've not checked that.

In passing, expose a SQL function to check for safe-snapshot blockage,
comparable to pg_blocking_pids. This is more or less free given the
infrastructure built to solve the other problem, so we might as well.

Thomas Munro

Discussion: https://postgr.es/m/20170407165749.pstcakbc637opkax@alap3.anarazel.de

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/511540dadf1166d80b864f63979178f324844060

Modified Files
--------------
doc/src/sgml/func.sgml | 27 ++++++-
src/backend/storage/lmgr/predicate.c | 50 +++++++++++++
src/backend/utils/adt/lockfuncs.c | 119 ++++++++++++++++++++++++++++++
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_proc.h | 6 +-
src/include/storage/predicate_internals.h | 2 +
src/test/isolation/.gitignore | 1 +
src/test/isolation/isolationtester.c | 12 +--
8 files changed, 206 insertions(+), 13 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2017-04-10 15:18:27 pgsql: Fix whitespace
Previous Message Andrew Dunstan 2017-04-10 13:00:19 Re: [COMMITTERS] pgsql: Sync pg_dump and pg_dumpall output