Re: [HACKERS] [PATCH] Pageinspect - add functions on GIN and GiSTindexes from gevel - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: [HACKERS] [PATCH] Pageinspect - add functions on GIN and GiSTindexes from gevel
Date
Msg-id 9f2a46be-e4d8-3f5e-9498-4a8529f1c4f7@2ndquadrant.com
Whole thread Raw
In response to Re: [HACKERS] [PATCH] Pageinspect - add functions on GIN and GiSTindexes from gevel  (Alexey Chernyshov <a.chernyshov@postgrespro.ru>)
Responses Re: [HACKERS] [PATCH] Pageinspect - add functions on GIN and GiSTindexes from gevel  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
On 9/13/17 03:45, Alexey Chernyshov wrote:
> On Sat, 9 Sep 2017 13:53:35 +0530
> Ashutosh Sharma <ashu.coek88@gmail.com> wrote:
> 
>>
>> Finally, i got some time to look into this patch and surprisingly I
>> didn't find any function returning information at page level instead
>> all the SQL functions are returning information at index level.
>> Therefore, i too feel that it should be either integrated with
>> pgstattuple which could a better match as Tomas also mentioned or may
>> be add a new contrib module itself. I think, adding a new contrib
>> module looks like a better option. The reason being, it doesn't simply
>> include the function for showing index level statistics (for e.g..
>> index size, no of rows, values..e.t.c) like pgstattuple does but,
>> also, displays information contained in a page for e.g. the object
>> stored in the page,  it's tid e.t.c. So, more or less, I would say
>> that, it's the mixture of pageinspect and pgstattuple module and
>> therefore, i feel, adding it as a new extension would be a better
>> choice. Thought?
> 
> Thank you for your interest, I will add a new contrib module named,
> say, indexstat. I think we can add statistics on other indexes in the
> future.

A few thoughts on this current patch:

The patch no longer compiles, because of changes in the way the tuple
descriptors are accessed (I think).

I agree with the conclusion so far that this should be a new extension,
not being a good fit for an existing extension.

This kind of thing doesn't look like good design:

+<screen>
+test=# SELECT spgist_stats('spgist_idx');
+           spgist_stats
+----------------------------------
+ totalPages:        21           +
+ deletedPages:      0            +
+ innerPages:        3            +
+ leafPages:         18           +
+ emptyPages:        1            +
+ usedSpace:         121.27 kbytes+
+ freeSpace:         46.07 kbytes +
+ fillRatio:         72.47%       +
+ leafTuples:        3669         +
+ innerTuples:       20           +
+ innerAllTheSame:   0            +
+ leafPlaceholders:  569          +
+ innerPlaceholders: 0            +
+ leafRedirects:     0            +
+ innerRedirects:    0            +
+</screen>

This function should return a row with columns for each of these pieces
of information.

So to summarize, I think there is interest in this functionality, but
the patch needs some work.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

pgsql-hackers by date:

Previous
From: Mark Dilger
Date:
Subject: Re: [HACKERS] Add some const decorations to prototypes
Next
From: Pavel Stehule
Date:
Subject: Re: [HACKERS] proposal: schema variables