Aggregate not using BRIN index on timestamp

Поиск
Список
Период
Сортировка
От Jeremy Finzel
Тема Aggregate not using BRIN index on timestamp
Дата
Msg-id CAMa1XUhGWTdDEx51RGZU7pU6T77QUtY-fn1HjYB9cGb2B=yrTQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: Aggregate not using BRIN index on timestamp  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hello -

I have started to make much more use of BRIN indexes on timestamp fields on tables which are insert-only.  I have seen great performance with these and of course far less overhead.

However, I am noticing that a simple aggregate is not using the index.  I don't find anything obvious in the docs as to why, and I am not sure if the operator is not actually supported, or for some reason it is not choosing it because of the estimate.

I have a very large table with 4 billion rows and a BRIN index on timestamp spanning from 2013 to present.  I am running this simple query:

SELECT MIN(created_at) FROM table;

It is choosing a parallel seq scan as opposed to a BRIN bitmap scan.

Please note also that the following queries that I am using are using the index with great performance:
SELECT * FROM table WHERE created_at > '2013-04-01' AND created_at <= '2013-04-08';

I can provide more info.  But first - am I missing something obvious?

Thanks,
Jeremy

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

Предыдущее
От: Kenneth Marshall
Дата:
Сообщение: Re: Compression In Postgresql 9.6
Следующее
От: Tom Lane
Дата:
Сообщение: Re: why toasted is created when domain is used ?