Re: pgstattuple extension for indexes

From: Satoshi Nagayasu <nagayasus(at)nttdata(dot)co(dot)jp>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, pgsql-patches(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>, ishii(at)sraoss(dot)co(dot)jp
Subject: Re: pgstattuple extension for indexes
Date: 2006-08-12 04:12:42
Message-ID: 44DD553A.6070301@nttdata.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Alvaro,

Alvaro Herrera wrote:
> Huh, I bet it works with 8.1.4, but it doesn't work on CVS HEAD:
>
> /pgsql/source/00orig/contrib/pgstattuple/pgstatindex.c: In function 'GetBTPageStatistics':
> /pgsql/source/00orig/contrib/pgstattuple/pgstatindex.c:182: error: 'BTItem' undeclared (first use in this function)
>
>
> While you're at it, please consider removing C++ style comments and
> unused code.
>
> Formatting is way off as well, but I guess that is easily fixed with
> pgindent.

Thanks for comments. I'm going to fix my patch from now.

> Regarding the pg_relpages function, why do you think it's necessary?
> (It returns the true number of blocks of a given relation). It may
> belong into core given a reasonable use case, but otherwise it doesn't
> seem to belong into pgstatindex (or pgstattuple for that matter).

I wanted to sample some pages from the table/index, and get their statistics
to know table/index conditions. I know pgstattuple() reports table
statistics, however, pgstattuple() generates heavy CPU and I/O load.

When we need to sample some pages from table/index, we need to know
true number of blocks.

I have another function, called pgstatpage(), to get information inside
a single block/page statistics of the table. pg_relpages() will be used
with this.

Sorry for not mentioned in previous post about pgstatpage(),
but I've remembered about it just now.

Many memories in my brain have already `paged-out` (too busy in last few months),
and some of them got `out-of-memory`. :^)

Thanks.
--
NAGAYASU Satoshi <nagayasus(at)nttdata(dot)co(dot)jp>
Phone: +81-3-3523-8122

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2006-08-12 04:18:09 Re: [COMMITTERS] pgsql: Allow commenting of variables in
Previous Message Bruce Momjian 2006-08-12 03:49:33 Re: [HACKERS] New variable server_version_num

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2006-08-12 04:22:26 Re: [PATCHES] Adding fulldisjunctions to the contrib
Previous Message Bruce Momjian 2006-08-12 03:49:33 Re: [HACKERS] New variable server_version_num