Re: GIN pageinspect functions

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Peter Geoghegan <pg(at)heroku(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: GIN pageinspect functions
Date: 2015-08-10 16:14:48
Message-ID: CAMkU=1xvzQxTAiYNM2PWJ6snMTPh3u3Ammbwss7mvAShS2Ohww@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Nov 21, 2014 at 2:04 AM, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com
> wrote:

> On 11/20/2014 05:52 AM, Michael Paquier wrote:
>
>> On Wed, Nov 19, 2014 at 7:01 AM, Peter Geoghegan <pg(at)heroku(dot)com> wrote:
>>
>>> On Tue, Nov 4, 2014 at 7:26 AM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)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 Content-Type Size
pageinspect_gin_leaf.patch application/octet-stream 938 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2015-08-10 16:16:21 Re: WIP: Rework access method interface
Previous Message Tom Lane 2015-08-10 16:10:08 Re: WIP: Rework access method interface