Re: pg_stat_all_indexes understand

Поиск
Список
Период
Сортировка
От Jeff Janes
Тема Re: pg_stat_all_indexes understand
Дата
Msg-id CAMkU=1wvRL88u_X0DSc78_TTCji0HqdDkKovN1wKoxEQcrV4cQ@mail.gmail.com
обсуждение исходный текст
Ответ на pg_stat_all_indexes understand  (Nicolas Paris <niparisco@gmail.com>)
Ответы Re: pg_stat_all_indexes understand
Список pgsql-performance

On Thu, Jul 9, 2015 at 5:20 AM, Nicolas Paris <niparisco@gmail.com> wrote:
Hello,

I wonder how understanding pg_stat_all_indexes working

When I run an explain, some index are not used, but pg_stat_all_indexes.idx_scan is incremented for those indexes.

When the planner considers using a merge join on a indexed column, it uses an index to check the endpoints of the column (the min and the max) to make sure it has the latest values to get the most accurate estimate.  This causes the usage counts to get incremented.  Even when it doesn't end up using the merge join.
 
Does this mean idx_scan is incremented each time the planner check if an index could be use whenever it won't use it ?

Not in general, only in a few peculiar cases.

Cheers,

Jeff

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

Предыдущее
От: "Graeme B. Bell"
Дата:
Сообщение: Re: Hmmm... why does CPU-intensive pl/pgsql code parallelise so badly when queries parallelise fine? Anyone else seen this?
Следующее
От: Nicolas Paris
Дата:
Сообщение: QUERY PLANNER - Indexe mono column VS composite Index