Re: Performance of IN (...) vs. = ANY array[...]

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Performance of IN (...) vs. = ANY array[...]
Дата
Msg-id 5373.1158351561@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Performance of IN (...) vs. = ANY array[...]  (Benjamin Minshall <minshall@intellicon.biz>)
Список pgsql-performance
Benjamin Minshall <minshall@intellicon.biz> writes:
> What are the advantages or disadvantages of using arrays in this
> situation?  The = ANY array method makes plpgsql development cleaner,
> but seems to really lack performance in certain cases.

In existing releases, the form with IN (list-of-scalar-constants)
can be optimized into indexscan(s), but = ANY (array) isn't.

8.2 will treat them equivalently (in fact, it converts IN (...) to
= ANY (ARRAY[...]) !).  So depending on your time horizon, you might
wish to stick with whichever is cleaner for your calling code.

            regards, tom lane

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

Предыдущее
От: Benjamin Minshall
Дата:
Сообщение: Performance of IN (...) vs. = ANY array[...]
Следующее
От: "Luke Lonergan"
Дата:
Сообщение: Re: RAID 0 not as fast as expected