Re: IN vs EXIIST

Поиск
Список
Период
Сортировка
От Jochem van Dieten
Тема Re: IN vs EXIIST
Дата
Msg-id 1032434291.3d89b27334cc7@webmail.oli.tudelft.nl
обсуждение исходный текст
Ответ на Re: IN vs EXIIST  ("Jan Weerts" <j.weerts@i-views.de>)
Список pgsql-general
Quoting Jan Weerts <j.weerts@i-views.de>:
>
> One
> of our expensive queries contains NOT IN and IN as subqueries. As I
> was advised on this list, I tried to replace IN with EXISTS. When
> doing so for part of the query (omitting one of the IN subqueries)
> the IN and EXIST versions are both about the same speed in execution
> (about 30sec).

I am wondering if the NOT might negate any positive effects from the
switch to EXIST.


> My next plan is to switch from 7.1.3 to 7.2, but that requires some
> planning, as the database is permamently used.

I would say that is a good idea anyway, but maybe you can post your
query. There might be a way to totally rewrite it like the CASE & GROUP
BY idea for Jean-Christian (not that that idea is faster by definition,
but you never know).

Jochem

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

Предыдущее
От: Ciprian Popovici
Дата:
Сообщение: some optimization?
Следующее
От: dima
Дата:
Сообщение: Re: some optimization?