pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ricardo Valença de Assis <valenca@campusvirtual.br>
To: Bruno Wolff III <bruno@wolff.to>
Cc: pgsql-admin@postgresql.org
Subject: Re: delete to slow
Date: Wed, 6 Apr 2005 14:32:55 -0300
Message-ID: <00e301c53ace$ab400260$1b00280a@ugf.br> (raw)
References: <006701c53ac8$014b27e0$1b00280a@ugf.br>
	<20050406173137.GA19739@wolff.to>

I´ve tried... It takes the same time. I used explain and I saw it... Exactly
the same time.
----- Original Message ----- 
From: "Bruno Wolff III" <bruno@wolff.to>
To: "Ricardo Valença de Assis" <valenca@campusvirtual.br>
Cc: <pgsql-admin@postgresql.org>
Sent: Wednesday, April 06, 2005 2:31 PM
Subject: Re: delete to slow


> On Wed, Apr 06, 2005 at 13:45:13 -0300,
>   Ricardo Valença de Assis <valenca@campusvirtual.br> wrote:
> > Hello Everybody!
> >
> >     I´m trying to use delete to remove data from one table based on
another. The query is this:
> >
> >     DELETE FROM table1 WHERE column1 IN (SELECT column2 FROM table2);
> >
> >     but my table is big, so it takes a lot o time...
> >     Is there a way to use DELETE with INNER JOIN in PostGreSQL?
>
> Yes. You should be able to do something like:
> DELETE FROM table1 WHERE column1 = table2.column2;




view thread (18+ messages)  latest in thread

Message-ID: <00e301c53ace$ab400260$1b00280a@ugf.br>
Permalink:  ../00e301c53ace$ab400260$1b00280a@ugf.br/
Also on:    postgresql.org/message-id/00e301c53ace$ab400260$1b00280a@ugf.br

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: valenca@campusvirtual.br, bruno@wolff.to
  Subject: Re: delete to slow
  In-Reply-To: <00e301c53ace$ab400260$1b00280a@ugf.br>
  References: <006701c53ac8$014b27e0$1b00280a@ugf.br> <20050406173137.GA19739@wolff.to> <00e301c53ace$ab400260$1b00280a@ugf.br>

* 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