Re: GIN pageinspect functions - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: GIN pageinspect functions
Date
Msg-id CAA4eK1+fasE1ZP-N438Saq9Z2vm9+ZizSzih_sxU8krcNaoHkQ@mail.gmail.com
Whole thread Raw
In response to GIN pageinspect functions  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Responses Re: GIN pageinspect functions  (Peter Geoghegan <pg@heroku.com>)
List pgsql-hackers
On Tue, Oct 7, 2014 at 10:33 PM, Heikki Linnakangas <hlinnakangas@vmware.com> wrote:
>
> Some time ago, when debugging a GIN bug, I wrote these pageinspect functions to inspect GIN indexes. They were very useful; we should add them.
>

I think these functions will be quite useful for debugging purpose
and we already have similar function's for other index (btree).

Few suggestions for patch:

1. Documentation seems to be missing, other API's exposed
via pageinspect are documented at:

2.
+CREATE FUNCTION gin_metapage(IN page bytea,
+    OUT pending_head bigint,
+    OUT pending_tail bigint,
+    
OUT tail_free_size int4,
+    OUT n_pending_pages bigint,
+    OUT n_pending_tuples bigint,
+    OUT 
n_total_pages bigint,
+    OUT n_entry_pages bigint,
+    OUT n_data_pages bigint,
+    OUT n_entries bigint,
+   
 OUT version int4)
+AS 'MODULE_PATHNAME', 'gin_metapage'
+LANGUAGE C STRICT;

a. Isn't it better to name the function as gin_metap(..) similar to
existing function bt_metap(..)?
b. Can this function have a similar signature as bt_metap() which means
it should take input as relname?

3. Can gin_dataleafpage() API have similar name and signature as
API bt_page_items() exposed for btree?

4. Can we have any better name for gin_pageopaq (other API name's
in this module are self explanatory)?


With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [REVIEW] Re: Fix xpath() to return namespace definitions
Next
From: Tom Lane
Date:
Subject: Re: Let's drop two obsolete features which are bear-traps for novices