• Robert Haas's avatar
    Fix pgstattuple's handling of unused hash pages. · 9cc27566
    Robert Haas authored
    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
    9cc27566
pgstatindex.c 20.3 KB