Re: pg_class.reltuples of brin indexes

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: pg_class.reltuples of brin indexes
Дата
Msg-id ZV0XpOx5rCrYLSPk@momjian.us
обсуждение исходный текст
Ответ на pg_class.reltuples of brin indexes  (Masahiko Sawada <sawada.mshk@gmail.com>)
Ответы Re: pg_class.reltuples of brin indexes  (Tomas Vondra <tomas.vondra@enterprisedb.com>)
Список pgsql-hackers
On Tue, Mar 27, 2018 at 08:58:11PM +0900, Masahiko Sawada wrote:
> Hi,
> 
> I found that pg_class.reltuples of brin indexes can be either the
> number of index tuples or the number of heap tuples.
> 
> =# create table test as select generate_series(1,100000) as c;
> =# create index test_brin on test using brin (c);
> =# analyze test;
> =# select relname, reltuples, relpages from pg_class where relname in
> ('test', 'test_brin');
>   relname  | reltuples | relpages
> -----------+-----------+----------
>  test      |     100000 |       443
>  test_brin |     100000 |        3
> (2 rows)
> 
> =# vacuum test;
> =# select relname, reltuples, relpages from pg_class where relname in
> ('test', 'test_brin');
>   relname  | reltuples | relpages
> -----------+-----------+----------
>  test      |     100000 |       443
>  test_brin |         3 |        3
> (2 rows)
> 
> If I understand correctly pg_class.reltuples of indexes should have
> the number of index tuples but especially for brin indexes it would be
> hard to estimate it in the analyze code. I thought that we can change
> brinvacuumcleanup so that it returns the estimated number of index
> tuples and do vac_update_relstats using that value but it would break
> API contract. Better ideas?

I assume there is nothing to do on this issue.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  Only you can decide what is important to you.



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Partial aggregates pushdown
Следующее
От: Daniel Gustafsson
Дата:
Сообщение: Re: proposal: possibility to read dumped table's name from file