Re: Poor Performance with Distinct Subqueries with EXISTS and EXCEPT

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Poor Performance with Distinct Subqueries with EXISTS and EXCEPT
Дата
Msg-id 8600.1102004805@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Poor Performance with Distinct Subqueries with EXISTS and EXCEPT  (Pierre-Frédéric Caillaud<lists@boutiquenumerique.com>)
Ответы Re: Poor Performance with Distinct Subqueries with EXISTS and EXCEPT
Список pgsql-general
=?iso-8859-15?Q?Pierre-Fr=E9d=E9ric_Caillaud?= <lists@boutiquenumerique.com> writes:
>     I may be mistaken, but you may be doing the same thing twice : you're
> basically writing :

>     SELECT DISTINCT X WHERE Y EXCEPT SELECT DISTINCT X WHERE NOT Y
>     Is this not a way to get an empty result set ?

No, because some X values may appear in rows where Y, and also in rows
where NOT Y.

The DISTINCTs are wastes of time, though, because EXCEPT implies
elimination of duplicates.

            regards, tom lane

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

Предыдущее
От: "Magnus Hagander"
Дата:
Сообщение: Re: Pl/Perl w/ Postgres 8.0 on Windows
Следующее
От: Thomas F.O'Connell
Дата:
Сообщение: Re: Poor Performance with Distinct Subqueries with EXISTS and EXCEPT