Re: Slow Queries with OR's?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Slow Queries with OR's?
Дата
Msg-id 26377.1051626135@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Slow Queries with OR's?  ("Mad Hatter" <mad_hatter_@hotmail.com>)
Список pgsql-general
"Mad Hatter" <mad_hatter_@hotmail.com> writes:
> When I run the following query:
> SELECT attrib1 FROM table1 WHERE attrib2 IN ( '1', '3', '5', '7' );

Could we see the EXPLAIN ANALYZE output for that, as well as one of
these?

> SELECT attrib1 FROM table1 WHERE attrib2 = '1'

ISTM you should be getting roughly equivalent plans, that is an
indexscan for each of the constants.

(The nearby comments about IN being slow apply to "foo IN (SELECT ...)"
which this is not.)

            regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Backend memory leakage when inserting
Следующее
От: Dennis Gearon
Дата:
Сообщение: Re: Bug(?) with cursors using aggregate functions.