Ottavio Campana <ottavio@xxxxxxxxxxxxx> í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 ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your message can get through to the mailing list cleanly