Re: PostgreSQL does not choose my indexes well

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: PostgreSQL does not choose my indexes well
Дата
Msg-id CAKFQuwbNs3Avhz0vXU3uabymEoxWsXH9bhCiMWDSkhuPt5-mHg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: PostgreSQL does not choose my indexes well  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: PostgreSQL does not choose my indexes well
Список pgsql-performance
On Thu, Apr 23, 2020 at 1:33 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
I find the apparently
unnecessary cast in the partial-index predicate to be suspicious ---
maybe that's blocking matching to the WHERE clause?

I noticed that too...I suspect its related to the ANALYZE result:

Index Scan using idx_tabla_entidad on entidad (cost=0.56..51121.41
rows=1405216 width=20) (actual time=0.037..242.609 rows=1409985 loops=1)
   Index Cond: ((cod_tabla)::bigint = 4)

Since the index condition ended up cast to bigint the OP probably wrote the predicate to match.

David J.

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: PostgreSQL does not choose my indexes well
Следующее
От: Tom Lane
Дата:
Сообщение: Re: PostgreSQL does not choose my indexes well