From: | Ricardo Valença de Assis <valenca(at)campusvirtual(dot)br> |
---|---|
To: | "Bruno Wolff III" <bruno(at)wolff(dot)to> |
Cc: | <pgsql-admin(at)postgresql(dot)org> |
Subject: | Re: delete to slow |
Date: | 2005-04-06 17:32:55 |
Message-ID: | 00e301c53ace$ab400260$1b00280a@ugf.br |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
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(at)wolff(dot)to>
To: "Ricardo Valença de Assis" <valenca(at)campusvirtual(dot)br>
Cc: <pgsql-admin(at)postgresql(dot)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(at)campusvirtual(dot)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;
From | Date | Subject | |
---|---|---|---|
Next Message | Jim C. Nasby | 2005-04-06 17:56:41 | Re: delete to slow |
Previous Message | Bruno Wolff III | 2005-04-06 17:31:37 | Re: delete to slow |