Re: delete to slow

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: delete to slow
Дата
Msg-id 20050406173137.GA19739@wolff.to
обсуждение исходный текст
Ответ на delete to slow  (Ricardo Valença de Assis <valenca@campusvirtual.br>)
Список pgsql-admin
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;

В списке pgsql-admin по дате отправления:

Предыдущее
От: Ricardo Valença de Assis
Дата:
Сообщение: delete to slow
Следующее
От: Tom Lane
Дата:
Сообщение: Re: delete to slow