Re: Index scan / Index cond limitation or ?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Index scan / Index cond limitation or ?
Дата
Msg-id 7091.1287167367@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Index scan / Index cond limitation or ?  (Nikolai Zhubr <n-a-zhubr@yandex.ru>)
Ответы Re: Index scan / Index cond limitation or ?  (Nikolai Zhubr <n-a-zhubr@yandex.ru>)
Список pgsql-performance
Nikolai Zhubr <n-a-zhubr@yandex.ru> writes:
> So, "in (1, 2)" condition is not in Index Cond anymore! Why is that? How
> can I push it back?

It thinks the indexscan condition is sufficiently selective already.
An = ANY condition like that will force multiple index searches,
one for each of the OR'd possibilities, so it's far from "free" to add
it to the index condition.  The planner doesn't think it's worth it.
Perhaps on your real query it is, but there's not much point in
debating about the behavior on this toy table; without realistic
table sizes and up-to-date stats it's impossible to say whether that
choice is correct or not.

> SELECT version();
> PostgreSQL 8.3.1, compiled by Visual C++ build 1400

You really, really, really ought to be running 8.3.something-newer.
We didn't put out the last 11 8.3.x bugfix updates just because
we didn't have anything better to do.

            regards, tom lane

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

Предыдущее
От: Tony Capobianco
Дата:
Сообщение: Re: oracle to psql migration - slow query in postgres
Следующее
От: Tom Lane
Дата:
Сообщение: Re: help with understanding EXPLAIN and boosting performance