Add pgstathashindex() to get hash index table statistics.
Ashutosh Sharma <ashu.coek88@gmail.com>
From: Ashutosh Sharma <ashu.coek88@gmail.com>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2016-12-21T13:52:05Z
Lists: pgsql-hackers
Attachments
- 0001-Add-pgstathashindex-to-pgstattuple-extension-v1.patch (text/x-patch) patch v1-0001
Hi All, I have introduced a new function 'pgstathashindex()' inside pgstatuple extension to view the statistics related to hash index table. I could have used 'pgstattuple()' function to view hash index stats instead of adding this new function but there are certain limitations when using pgstattuple() for hash indexes. Firstly, it doesn't work if a hash index contains zero or new pages which is very common in case of hash indexes. Secondly, it doesn't provide information about different types of pages in hash index and its count. Considering these points, I have thought of introducing this function. Attached is the patch for the same. Please have a look and let me your feedback. I would also like to mention that this idea basically came from my colleague Kuntal Ghosh and i implemented it. I have also created a commit-fest entry for this submission. 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