Ottavio Campana <ottavio@campana.vi.it> í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