Thread: delete to slow
View Single Post

   
  #4 (permalink)  
Old 04-10-2008, 12:39 AM
=?iso-8859-1?Q?Ricardo_Valen=E7a_de_Assis?=
 
Posts: n/a
Default Re: delete to slow

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;



---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Reply With Quote