Re: [PATCH] Pageinspect - add functions on GIN and GiST indexes from gevel

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Alexey Chernyshov <a(dot)chernyshov(at)postgrespro(dot)ru>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] Pageinspect - add functions on GIN and GiST indexes from gevel
Date: 2017-11-01 18:47:29
Message-ID: 9f2a46be-e4d8-3f5e-9498-4a8529f1c4f7@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 9/13/17 03:45, Alexey Chernyshov wrote:
> On Sat, 9 Sep 2017 13:53:35 +0530
> Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2017-11-01 19:19:48 Re: proposal: schema variables
Previous Message Mark Dilger 2017-11-01 18:27:28 Re: Add some const decorations to prototypes