Re: only one index is using, why?

Поиск
Список
Период
Сортировка
От Marti Raudsepp
Тема Re: only one index is using, why?
Дата
Msg-id AANLkTikAWrH36myhdgYghVrtVf1h92iOp6hcd2rDZL+h@mail.gmail.com
обсуждение исходный текст
Ответ на only one index is using, why?  (AI Rumman <rummandba@gmail.com>)
Список pgsql-performance
On Wed, Dec 15, 2010 at 08:56, AI Rumman <rummandba@gmail.com> wrote:
> My question is why "crmentity_setype_idx" index is being used only.
> "crmentity_deleted_idx" index is not using.
> Any idea please.

Because the planner determined that the cost of scanning *two* indexes
and combining the results is more expensive than scanning one index
and filtering the results afterwards.

Looks like your query could use a composite index on both columns:
(deleted, setype)
Or a partial index:  (setype) WHERE deleted=0

Regards,
Marti

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

Предыдущее
От: AI Rumman
Дата:
Сообщение: only one index is using, why?
Следующее
От: Rauan Maemirov
Дата:
Сообщение: Problems with FTS