Re: where (x,y,z) in ((x1,y1, z1), (x1,y1, z1), (x1,y1, z1), (x2,y2, z2)) (not) optimized

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: where (x,y,z) in ((x1,y1, z1), (x1,y1, z1), (x1,y1, z1), (x2,y2, z2)) (not) optimized
Дата
Msg-id 10677.1232984194@sss.pgh.pa.us
обсуждение исходный текст
Ответ на where (x,y,z) in ((x1,y1, z1), (x1,y1, z1), (x1,y1, z1), (x2,y2, z2)) (not) optimized  (Grzegorz Jaśkiewicz <gryzman@gmail.com>)
Список pgsql-general
=?UTF-8?Q?Grzegorz_Ja=C5=9Bkiewicz?= <gryzman@gmail.com> writes:
> why :
> select * from foo where X in (1,1,1,1,1,1,1,1) --- same values in search.
> never gets optimized by planner, etc ?

We actually did that, before 8.0 or thereabouts.  It was removed because
it cost a lot of planner cycles for *every* query, and helped for only
a small number of stupidly-written ones.

In general, you can probably remove such duplicates on the client side
more efficiently than the database could anyway (realizing that whatever
it might do has to be datatype-independent).

            regards, tom lane

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

Предыдущее
От: Matthias Karlsson
Дата:
Сообщение: Re: How to do an UPDATE for all the fields that do NOT break a constraint?
Следующее
От: Asko Oja
Дата:
Сообщение: Re: dblink syntax question for remotely invoking void-returning procedures