Re: Add pgstathashindex() to get hash index table statistics.

From: Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>
To: Kuntal Ghosh <kuntalghosh(dot)2007(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add pgstathashindex() to get hash index table statistics.
Date: 2017-01-06 13:28:01
Message-ID: CAE9k0Pk_1X-vk3=Lyork5LkxcHNuMrEcpioF32AhyYjuf=WjuQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-hackers

Hi,

> I think the calculation for max available spcae is wrong here. You
> should subtract the page header and special area from the total page size.
> A check for non-zero denominator should be added while calculating the
> percentage.
> There can be multiple bitmap pages. Right?

Yes, we can have multiple bitmap pages. I have adjusted the
calculation for free space percentage accordingly. Please check the
attached v2 patch.

>
> + values[10] = Float8GetDatum(free_percent);
> Some precision should be added.

Corrected. Please refer v2 patch.

>
> + <row>
> + <entry><structfield>ffactor</structfield></entry>
> + <entry><type>integer</type></entry>
> + <entry>Average number of tuples per bucket</entry>
> + </row>
> I feel that either the column name should be changed or it should
> just output how full the index method is in percentage.

Fixed. Refer to v2 patch.

>
> + </varlistentry>
> +
> +
> + <varlistentry>
> Please remove extra spaces.

Done. Please refer to v2 patch.

>
> And, please add some test cases for regression tests.
>
Added a test-case. Please check v2 patch attached with this mail.

--
With Regards,
Ashutosh Sharma.
EnterpriseDB: http://www.enterprisedb.com

Attachment Content-Type Size
0001-Add-pgstathashindex-to-pgstattuple-extension-v2.patch invalid/octet-stream 17.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Steele 2017-01-06 13:30:35 Re: Support for pg_receivexlog --post-segment command
Previous Message Feike Steenbergen 2017-01-06 13:09:48 Re: Support for pg_receivexlog --post-segment command