pgsql: Fix pgstattuple's handling of unused hash pages.

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix pgstattuple's handling of unused hash pages.
Date: 2017-04-12 16:22:58
Message-ID: E1cyL2o-0008AN-Qr@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix pgstattuple's handling of unused hash pages.

Hash indexes can contain both pages which are all-zeroes (i.e.
PageIsNew()) and pages which have been initialized but currently
aren't used. The latter category can happen either when a page
has been reserved but not yet used or when it is used for a time
and then freed. pgstattuple was only prepared to deal with the
pages that are actually-zeroes, which it called zero_pages.
Rename the column to unused_pages (extension version 1.5 is
as-yet-unreleased) and make it count both kinds of unused pages.

Along the way, slightly tidy up the way we test for pages of
various types.

Robert Haas and Ashutosh Sharma, reviewed by Amit Kapila

Discussion: http://postgr.es/m/CAE9k0PkTtKFB3YndOyQMjwuHx+-FtUP1ynK8E-nHtetoow3NtQ@mail.gmail.com

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/9cc27566c1a8d659c15b9eea2413dcc07a7a42c9

Modified Files
--------------
contrib/pgstattuple/expected/pgstattuple.out | 6 +++---
contrib/pgstattuple/pgstatindex.c | 24 +++++++++++++++---------
contrib/pgstattuple/pgstattuple--1.4--1.5.sql | 2 +-
doc/src/sgml/pgstattuple.sgml | 6 +++---
4 files changed, 22 insertions(+), 16 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2017-04-12 18:47:08 pgsql: Remove some tabs in SQL code in C string literals
Previous Message Robert Haas 2017-04-12 15:35:41 pgsql: Code review for c94e6942cefe7d20c5feed856e27f672734b1e2b.