Re: query against large table not using sensible index to find very small amount of data

Поиск
Список
Период
Сортировка
От Jeff Janes
Тема Re: query against large table not using sensible index to find very small amount of data
Дата
Msg-id CAMkU=1wXAoZFdNmh43B+RvmsG4RfmPXaMLqi+imU81WWFSw_cA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: query against large table not using sensible index to find very small amount of data  (Shaun Thomas <sthomas@optionshouse.com>)
Список pgsql-performance
On Tue, Apr 8, 2014 at 6:39 AM, Shaun Thomas <sthomas@optionshouse.com> wrote:

> Other possibly relevant pieces of information...  The entity type
> column has a cardinality in the neighborhood of a couple dozen.
> Meanwhile, for some of the entity types there is a large and ongoing
> number of events, and for other entity types there is a smaller and
> more sporadic number of events.  Every now and again a new entity
> type shows up.

With that as the case, I have two questions for you:

1. Why do you have a low cardinality column as the first column in an index?

Because if he didn't have it, the planner would never be able to use it.  Remember, the problem is when the planner chooses NOT to use that index.

Cheers,

Jeff

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Performance regressions in PG 9.3 vs PG 9.0
Следующее
От: uher dslij
Дата:
Сообщение: Re: Performance regressions in PG 9.3 vs PG 9.0