pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Steve Crawford <scrawford@pinpointresearch.com>
To: luca.scaramella@recom.it
To: pgsql-sql@postgresql.org
Subject: Re: DELETE FROM A BLACK LIST
Date: Wed, 12 Mar 2003 12:49:07 -0800
Message-ID: <20030312204906.E1AC5103C2@polaris.pinpointresearch.com> (raw)
In-Reply-To: <OFC425EC90.A6DA753C-ONC1256CE0.003861F2@recom.it>
References: <OFC425EC90.A6DA753C-ONC1256CE0.003861F2@recom.it>

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)



view thread (8+ messages)  latest in thread

Message-ID: <20030312204906.E1AC5103C2@polaris.pinpointresearch.com>
Permalink:  ../20030312204906.E1AC5103C2@polaris.pinpointresearch.com/
Also on:    postgresql.org/message-id/20030312204906.E1AC5103C2@polaris.pinpointresearch.com

 · 

reply

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: scrawford@pinpointresearch.com, luca.scaramella@recom.it
  Subject: Re: DELETE FROM A BLACK LIST
  In-Reply-To: <20030312204906.E1AC5103C2@polaris.pinpointresearch.com>

* 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