Re: GIN pageinspect functions - Mailing list pgsql-hackers

From Jeff Janes
Subject Re: GIN pageinspect functions
Date
Msg-id CAMkU=1xvzQxTAiYNM2PWJ6snMTPh3u3Ammbwss7mvAShS2Ohww@mail.gmail.com
Whole thread Raw
In response to Re: GIN pageinspect functions  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Responses Re: [HACKERS] GIN pageinspect functions  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
On Fri, Nov 21, 2014 at 2:04 AM, Heikki Linnakangas <hlinnakangas@vmware.com> wrote:
On 11/20/2014 05:52 AM, Michael Paquier wrote:
On Wed, Nov 19, 2014 at 7:01 AM, Peter Geoghegan <pg@heroku.com> wrote:
On Tue, Nov 4, 2014 at 7:26 AM, Amit Kapila <amit.kapila16@gmail.com> wrote:
1. Documentation seems to be missing, other API's exposed
via pageinspect are documented at:
http://www.postgresql.org/docs/devel/static/pageinspect.html
Done.

2.
+CREATE FUNCTION gin_metapage(IN page bytea,
+    OUT pending_head bigint,
+    OUT pending_tail 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(..)?
I actually liked more gin_metapage_info, a name similar to the
newly-introduced brin indexes.

b. Can this function have a similar signature as bt_metap() which means
it should take input as relname?
That's mostly a matter of taste but I think we should definitely pass
a raw page to it as it is now. This has the advantage to add an extra
check if the page passed is really a meta page of not, something
useful for development.

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

The signature of bt_page_items() isn't a good example to follow. It existed before the get_raw_page() function, and the other functions that are designed to work with that, was added. gin_leafpage_items() name seems fine to me.


When I call gin_leafpage_items on a {leaf} page, I get the ERROR:

ERROR:  input page is not a compressed GIN data leaf page
DETAIL:  Flags 0002, expected 0083

I'm don't know why it won't work on an uncompressed leaf page (or for that matter, why my index pages are not compressed), but the docs should probably note the restriction.

Cheers,

Jeff
Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: WIP: Rework access method interface
Next
From: Alvaro Herrera
Date:
Subject: Re: WIP: Rework access method interface