Re: pgstattuple extension for indexes
От | Satoshi Nagayasu |
---|---|
Тема | Re: pgstattuple extension for indexes |
Дата | |
Msg-id | 44DD553A.6070301@nttdata.co.jp обсуждение исходный текст |
Ответ на | Re: pgstattuple extension for indexes (Alvaro Herrera <alvherre@commandprompt.com>) |
Ответы |
Re: pgstattuple extension for indexes
|
Список | 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@nttdata.co.jp> Phone: +81-3-3523-8122
В списке pgsql-patches по дате отправления: