Re: Drawbacks of create index where is not null ?

Поиск
Список
Период
Сортировка
От Franck Routier
Тема Re: Drawbacks of create index where is not null ?
Дата
Msg-id 507681DD.2000906@axege.com
обсуждение исходный текст
Ответ на Re: Drawbacks of create index where is not null ?  (Craig Ringer <ringerc@ringerc.id.au>)
Список pgsql-performance
Le 11/10/2012 07:26, Craig Ringer a écrit :
> * The partial index will only be used for queries that use the
> condition "WHERE col IS NOT NULL" themselves. The planner isn't
> super-smart about how it matches index WHERE conditions to query WHERE
> conditions, so you'll want to use exactly the same condition text
> where possible.
>

 From my experiments, the planner seems to be smart enougth to tell that
"where col = 'myvalue' " will match with partial index "where col is not
null".
So it will use the index and not do a full tablescan. (this is on 8.4).
This is also what Scott says in his reply.
I'm not thinking of using more complex where predicat for my indexes,
just "is not null". So I think I should not be hit by this...

Thanks,
Franck


Вложения

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

Предыдущее
От: Sergey Konoplev
Дата:
Сообщение: Re: hash aggregation
Следующее
От: Andrea Suisani
Дата:
Сообщение: Re: Two identical systems, radically different performance