Re: [HACKERS] pageinspect: Hash index support - Mailing list pgsql-hackers
From | Ashutosh Sharma |
---|---|
Subject | Re: [HACKERS] pageinspect: Hash index support |
Date | |
Msg-id | CAE9k0Pn0D_8khiKvg8PGUFpGDiiBi8Ok-qzVQwqW5WJKiZSLQQ@mail.gmail.com Whole thread Raw |
In response to | Re: pageinspect: Hash index support (Tom Lane <tgl@sss.pgh.pa.us>) |
Responses |
Re: [HACKERS] pageinspect: Hash index support
Re: [HACKERS] pageinspect: Hash index support |
List | pgsql-hackers |
Hi All, I have spent some time in reviewing the latest v8 patch from Jesper and could find some issues which i would like to list down, 1) Firstly, the DATA section in the Makefile is referring to "pageinspect--1.6.sql" file and currently this file is missing. +DATA = pageinspect--1.6.sql pageinspect--1.5--1.6.sql 2) Secondly, I can see that the server is crashing when following queries are executed on a code build with cassert-enabled. postgres=# SELECT * FROM hash_page_items(get_raw_page('con_hash_index', 25000)); server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. The connection to the server was lost. Attempting reset: Failed. !> \q [ashu@localhost bin]$ ./psql -d postgres psql (10devel) Type "help" for help. postgres=# SELECT * FROM hash_page_stats(get_raw_page('con_hash_index', 25000)); server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. The connection to the server was lost. Attempting reset: Failed. !> \q postgres=# SELECT * FROM hash_metapage_info(get_raw_page('con_hash_index', 25000)); server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. The connection to the server was lost. Attempting reset: Failed. !> 3) Thirdly, AFAIU the functions hash_page_stats() and hash_page_items() are basically dedicated for bucket and overflow pages in hash index and may not be used with bitmap page. It is currently blocked for metapage but not for the bitmap page. I think we need to block it for bitmap page as well. Apart from issues listed above there are few other review comments that has not been addressed yet. Considering the fact that it is a very important project from hash index perspective and as there has been no work being done on this project for quite some time, I thought of working on it to close some of the open review comments along with the issues found by myself. I would like to share the revised patch which is based on Jesper's v8 patch. The patch has mainly following following changes in it, 1) It introduces two new functions hash_page_type() and hash_bitmap_info(). hash_page_type basically displays the type of hash page whereas hash_bitmap_info() shows the status of a bit for a particular overflow page in bitmap page of hash index. 2) The functions hash_page_stats() and hash_page_items() basically shows the information about data stored in bucket and overflow pages of hash index. If a metapage or bitmap page is passed as an input to this function it throws an error saying "Expected page type:'' got: ''". 3) It also improves verify_hash_page() function to handle any type of page in hash index. It is now being used as verify_hash_page('raw_page', <page_type>) to verify if the page passed to this function is of 'page_type' or not. Here page_type can be LH_META_PAGE, LH_BUCKET_PAGE, LH_OVERFLOW_PAGE, LH_BITMAP_PAGE. Attached is the revised patch. Please have a look and let me know your feedback. I have also changed the status for this patch in the upcoming commitfest to "needs review". Thanks. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Attachment
pgsql-hackers by date: