Re: [GENERAL] Except operation

Поиск
Список
Период
Сортировка
От Adriaan Joubert
Тема Re: [GENERAL] Except operation
Дата
Msg-id 384614C2.5D11E898@albourne.com
обсуждение исходный текст
Ответ на Except operation  (Satyajeet Seth <csa98016@cse.iitd.ernet.in>)
Ответы Re: [GENERAL] Except operation
Список pgsql-general
Satyajeet Seth wrote:
>
> Hi
> The query:
> select * from webdata except select * from webdata1;
>  takes abysmally long .How can I optimise it?
> The particulars are:

You could try

  select * from webdata w
  where not exists
    (select * from webdata1 w1
     where w1.tid=w.tid
      ...
        )

If you have the correct indexes on webdata1 this can be quite fast.

Adriaan

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

Предыдущее
От: Lincoln Yeoh
Дата:
Сообщение: Re: [GENERAL] Re: pgsql-general-digest V1 #550
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: [GENERAL] postgres libpq library