Re: planer don't use index. bad plan for where id = x or id in (select ...)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: planer don't use index. bad plan for where id = x or id in (select ...)
Дата
Msg-id 8712.1085588867@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: planer don't use index. bad plan for where id = x or id in (select ...)  (Greg Stark <gsstark@mit.edu>)
Список pgsql-general
Greg Stark <gsstark@mit.edu> writes:
> ... And you can use UNION ALL instead of UNION
> since the IN will eliminate duplicates anyways. This avoids an extra
> sort/uniquify step.

FWIW, CVS tip realizes that it doesn't need two unique-ification steps
in this scenario.  But I agree that UNION ALL is the cleaner way to
write the query.

            regards, tom lane

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

Предыдущее
От: "Mario Soto"
Дата:
Сообщение: performance very slow
Следующее
От: "Matt Van Mater"
Дата:
Сообщение: Re: [HACKERS] COPY formatting