X-Original-To: pgsql-sql@postgresql.org Received: from polaris.pinpointresearch.com (66-7-238-176.cust.telepacific.net [66.7.238.176]) by postgresql.org (Postfix) with ESMTP id F0AEC475A4B for ; Wed, 12 Mar 2003 15:49:05 -0500 (EST) Received: from there (66-7-238-179.cust.telepacific.net [66.7.238.179]) by polaris.pinpointresearch.com (Postfix) with SMTP id E1AC5103C2; Wed, 12 Mar 2003 12:49:06 -0800 (PST) Content-Type: text/plain; charset="iso-8859-1" From: Steve Crawford Organization: Pinpoint Research To: luca.scaramella@recom.it, pgsql-sql@postgresql.org Subject: Re: DELETE FROM A BLACK LIST Date: Wed, 12 Mar 2003 12:49:07 -0800 X-Mailer: KMail [version 1.3.1] References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <20030312204906.E1AC5103C2@polaris.pinpointresearch.com> X-Archive-Number: 200303/309 X-Sequence-Number: 12348 delete from t1 where not exists (select blacklist.id from blacklist where blacklist.id=t1.id); (if I recall the full syntax correctly - you get the idea: use "exists") Cheers, Steve On Wednesday 05 March 2003 2:27 am, luca.scaramella@recom.it wrote: > Hi all, > I have a Blacklist table containing about 1000 ID to delete from another > table (T1 about 1440294 records) > If i use the SQL > > DELETE FROM T1 WHERE T1.ID IN (SELECT BLACKLIST.ID FROM BLACKLIST) > > the operation is very slow . > > There is a faster way to do the same operation?? > > Thanks > Luca > > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)