From: Chad Thompson <chad@weblinkservices.com>
To: pgsql-sql@postgresql.org
To: luca.scaramella@recom.it
Subject: Re: DELETE FROM A BLACK LIST
Date: Wed, 5 Mar 2003 08:52:46 -0700
Message-ID: <0b6301c2e32f$44fcc720$32021aac@chad> (raw)
References: <OF93BA7C2A.CBC03AC0-ONC1256CE0.003B13D5@recom.it>
You could use where exists.
delete from t1 where exists (select id from blacklist as b where b.id =
t1.id)
HTH
Chad
----- Original Message -----
From: <luca.scaramella@recom.it>
To: <pgsql-sql@postgresql.org>
Sent: Wednesday, March 05, 2003 3:45 AM
Subject: [SQL] DELETE FROM A BLACK LIST
>
> 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 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: chad@weblinkservices.com, luca.scaramella@recom.it
Subject: Re: DELETE FROM A BLACK LIST
In-Reply-To: <0b6301c2e32f$44fcc720$32021aac@chad>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox