postgresql/contrib/pgstattuple
Robert Haas d4b5d4cadd pgstattuple: Don't take heavyweight locks when examining a hash index.
It's currently necessary to take a heavyweight lock when scanning a
hash bucket, but pgstattuple only examines individual pages, so it
doesn't need to do this.  If, for some hypothetical reason, it did
need to do any heavyweight locking here, this logic would probably
still be incorrect, because most of the locks that it is taking are
meaningless.  Only a heavyweight lock on a primary bucket page has any
meaning, but this takes heavyweight locks on all pages regardless of
function - and in particular overflow pages, where you might imagine
that we'd want to lock the primary bucket page if we needed to lock
anything at all.

This is arguably a bug that has existed since this code was added in
commit dab42382f4, but I'm not going to
bother back-patching it because in most cases the only consequence is
that running pgstattuple() on a hash index is a little slower than it
otherwise might be, which is no big deal.

Extracted from a vastly larger patch by Amit Kapila which heavyweight
locking for hash indexes entirely; analysis of why this can be done
independently of the rest by me.
2016-10-28 12:21:15 -04:00
..
expected Fix multiple bugs in contrib/pgstattuple's pgstatindex() function. 2016-02-18 15:40:35 -05:00
sql Fix multiple bugs in contrib/pgstattuple's pgstatindex() function. 2016-02-18 15:40:35 -05:00
.gitignore Add a regression test for pgstattuple. 2011-08-25 00:06:16 -04:00
Makefile Remove superuser checks in pgstattuple 2016-09-29 22:13:38 -04:00
pgstatapprox.c Remove superuser checks in pgstattuple 2016-09-29 22:13:38 -04:00
pgstatindex.c Remove superuser checks in pgstattuple 2016-09-29 22:13:38 -04:00
pgstattuple--1.0--1.1.sql Add pgstatginindex() function to get the size of the GIN pending list. 2012-12-05 09:58:03 +02:00
pgstattuple--1.1--1.2.sql Fix pgstattuple functions to use regclass-type as the argument. 2013-07-19 03:50:20 +09:00
pgstattuple--1.2--1.3.sql Add pgstattuple_approx() to the pgstattuple extension. 2015-05-13 07:35:06 +02:00
pgstattuple--1.3--1.4.sql Update pgstattuple extension for parallel query. 2016-06-10 10:42:03 -04:00
pgstattuple--1.4--1.5.sql Remove superuser checks in pgstattuple 2016-09-29 22:13:38 -04:00
pgstattuple--1.4.sql Minor fixes in contrib installation scripts. 2016-06-14 10:47:06 -04:00
pgstattuple--unpackaged--1.0.sql Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:37 +02:00
pgstattuple.c pgstattuple: Don't take heavyweight locks when examining a hash index. 2016-10-28 12:21:15 -04:00
pgstattuple.control Remove superuser checks in pgstattuple 2016-09-29 22:13:38 -04:00