pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@postgresql.org
Subject: pgsql: Fix pgstattuple's handling of unused hash pages.
Date: Wed, 12 Apr 2017 16:22:58 +0000
Message-ID: <E1cyL2o-0008AN-Qr@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Message-ID: <E1cyL2o-0008AN-Qr@gemulon.postgresql.org>
Permalink:  ../E1cyL2o-0008AN-Qr@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1cyL2o-0008AN-Qr@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: rhaas@postgresql.org
  Subject: Re: pgsql: Fix pgstattuple's handling of unused hash pages.
  In-Reply-To: <E1cyL2o-0008AN-Qr@gemulon.postgresql.org>
  References: <E1cyL2o-0008AN-Qr@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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