Re: "not in" clause too slow?

Поиск
Список
Период
Сортировка
Искать
От
panther-d@freemail.hu
Тема
Re: "not in" clause too slow?
Дата
Msg-id
freemail.20070821164148.78288@fm03.freemail.hu
Ответ на
Список
Дерево обсуждения
"not in" clause too slow? Ottavio Campana <ottavio@campana.vi.it>
Re: "not in" clause too slow? Martijn van Oosterhout <kleptog@svana.org>
Re: "not in" clause too slow? Alban Hertroys <a.hertroys@magproductions.nl>
Re: "not in" clause too slow? Ottavio Campana <ottavio@campana.vi.it>
Re: "not in" clause too slow? panther-d@freemail.hu
Re: "not in" clause too slow? Ottavio Campana <ottavio@campana.vi.it>
Re: "not in" clause too slow? "Rodrigo De León" <rdeleonp@gmail.com>
Ottavio Campana  írta:

> mytable.id is primary key.
> 
> I create copy_mytable with
> create table copy_mytable as (select * from mytable);
> 
> the planer behavior does not change no matter if I create and index
> on copy_mytable.id or not.


Try this, with an index on copy_mytable.id:

SELECT orig.* FROM mytable AS orig WHERE NOT EXISTS (
  SELECT 1 FROM copy_mytable AS copy WHERE copy.id = orig.id
);


Regards,
Denes Daniel

Olvasd az [origo]-t a mobilodon: mini magazinok a Mobizin-en
___________________________________________________
www.t-mobile.hu/mobizin

В списке pgsql-general по дате отправления
От: Scott Marlowe
Дата:
Сообщение: Re: autovacuum
От: Ben
Дата:
FAQ