Re: DELETE FROM A BLACK LIST

From: "Chad Thompson" <chad(at)weblinkservices(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>, <luca(dot)scaramella(at)recom(dot)it>
Subject: Re: DELETE FROM A BLACK LIST
Date: 2003-03-05 15:52:46
Message-ID: 0b6301c2e32f$44fcc720$32021aac@chad
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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(dot)scaramella(at)recom(dot)it>
To: <pgsql-sql(at)postgresql(dot)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(at)postgresql(dot)org
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Gary Stainburn 2003-03-05 16:00:12 Re: sort / limit / range problem
Previous Message Greg Stark 2003-03-05 15:22:46 Re: LIMIT and SUBQUERIES