pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedDELETE FROM A BLACK LIST
8+ messages / 6 participants
[nested] [flat]
* DELETE FROM A BLACK LIST
@ 2003-03-05 10:27 luca.scaramella@recom.it
0 siblings, 2 replies; 8+ messages in thread
From: luca.scaramella@recom.it @ 2003-03-05 10:27 UTC (permalink / raw)
To: pgsql-sql
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
^ permalink raw reply [nested|flat] 8+ messages in thread
* DELETE FROM A BLACK LIST
@ 2003-03-05 10:44 luca.scaramella@recom.it
0 siblings, 0 replies; 8+ messages in thread
From: luca.scaramella@recom.it @ 2003-03-05 10:44 UTC (permalink / raw)
To: pgsql-sql
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
^ permalink raw reply [nested|flat] 8+ messages in thread
* DELETE FROM A BLACK LIST
@ 2003-03-05 10:45 luca.scaramella@recom.it
0 siblings, 2 replies; 8+ messages in thread
From: luca.scaramella@recom.it @ 2003-03-05 10:45 UTC (permalink / raw)
To: pgsql-sql
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
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: DELETE FROM A BLACK LIST
@ 2003-03-05 14:27 Christoph Haller <ch@rodos.fzk.de>
0 siblings, 0 replies; 8+ messages in thread
From: Christoph Haller @ 2003-03-05 14:27 UTC (permalink / raw)
To: pgsql-sql; +Cc: luca.scaramella@recom.it
>
> 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??
>
Try
DELETE FROM T1 WHERE T1.ID = BLACKLIST.ID
It really works.
Regards, Christoph
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: DELETE FROM A BLACK LIST
@ 2003-03-05 15:21 Achilleus Mantzios <achill@matrix.gatewaynet.com>
parent: luca.scaramella@recom.it
1 sibling, 0 replies; 8+ messages in thread
From: Achilleus Mantzios @ 2003-03-05 15:21 UTC (permalink / raw)
To: luca.scaramella@recom.it; +Cc: pgsql-sql
On Wed, 5 Mar 2003 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??
use EXISTS
>
> Thanks
> Luca
>
>
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>
--
==================================================================
Achilleus Mantzios
S/W Engineer
IT dept
Dynacom Tankers Mngmt
Nikis 4, Glyfada
Athens 16610
Greece
tel: +30-210-8981112
fax: +30-210-8981877
email: achill@matrix.gatewaynet.com
mantzios@softlab.ece.ntua.gr
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: DELETE FROM A BLACK LIST
@ 2003-03-05 15:52 Chad Thompson <chad@weblinkservices.com>
parent: luca.scaramella@recom.it
1 sibling, 0 replies; 8+ messages in thread
From: Chad Thompson @ 2003-03-05 15:52 UTC (permalink / raw)
To: pgsql-sql; luca.scaramella@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
>
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: DELETE FROM A BLACK LIST
@ 2003-03-12 20:49 Steve Crawford <scrawford@pinpointresearch.com>
parent: luca.scaramella@recom.it
1 sibling, 0 replies; 8+ messages in thread
From: Steve Crawford @ 2003-03-12 20:49 UTC (permalink / raw)
To: luca.scaramella@recom.it; pgsql-sql
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)
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: DELETE FROM A BLACK LIST
@ 2003-03-12 21:03 Bruno Wolff III <bruno@wolff.to>
parent: luca.scaramella@recom.it
1 sibling, 0 replies; 8+ messages in thread
From: Bruno Wolff III @ 2003-03-12 21:03 UTC (permalink / raw)
To: luca.scaramella@recom.it; +Cc: pgsql-sql
On Wed, Mar 05, 2003 at 11:27:54 +0100,
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)
Use:
delete from t1 where t1.id = blacklist.id;
^ permalink raw reply [nested|flat] 8+ messages in thread
end of thread, other threads:[~2003-03-12 21:03 UTC | newest]
Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-03-05 10:27 DELETE FROM A BLACK LIST luca.scaramella@recom.it
2003-03-12 20:49 ` Steve Crawford <scrawford@pinpointresearch.com>
2003-03-12 21:03 ` Bruno Wolff III <bruno@wolff.to>
2003-03-05 10:44 DELETE FROM A BLACK LIST luca.scaramella@recom.it
2003-03-05 10:45 DELETE FROM A BLACK LIST luca.scaramella@recom.it
2003-03-05 15:21 ` Achilleus Mantzios <achill@matrix.gatewaynet.com>
2003-03-05 15:52 ` Chad Thompson <chad@weblinkservices.com>
2003-03-05 14:27 Re: DELETE FROM A BLACK LIST Christoph Haller <ch@rodos.fzk.de>
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