Re: Add pgstathashindex() to get hash index table statistics.
Ashutosh Sharma <ashu.coek88@gmail.com>
From: Ashutosh Sharma <ashu.coek88@gmail.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>,
Michael Paquier <michael.paquier@gmail.com>, Kuntal Ghosh <kuntalghosh.2007@gmail.com>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2017-04-06T05:15:26Z
Lists: pgsql-hackers
Hi, >> >> Based on the earlier discussions, I have prepared a patch that would >> allow pgstathashindex() to show the number of unused pages in hash >> index. Please find the attached patch for the same. Thanks. > > My idea is that we shouldn't end up with both a zero_pages column and > an unused_pages column. Instead, we should end up with just an > unused_pages column, which will include both pages that are all-zeroes > and pages that have a valid special space marked as LH_UNUSED. > > Also, I don't see why it's correct to test PageIsEmpty() here instead > of just testing the page type as we do in pageinspect. > > Attached is a revised patch that shows what I have in mind; please > review. Along the way I made the code for examining the page type > more similar to what pageinspect does, because I see no reason for > those things to be different, and I think the pageinspect code is > better. I have reviewed the patch and it looks good to me. Also, the idea of including both zero and unused pages in a single 'unused' column looks better. Thanks. -- With Regards, Ashutosh Sharma EnterpriseDB:http://www.enterprisedb.com
Commits
-
Fix pgstattuple's handling of unused hash pages.
- 9cc27566c1a8 10.0 landed
-
Move some things from builtins.h to new header files
- f21a563d25db 10.0 cited