Re: delete taking long time

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: delete taking long time
Дата
Msg-id CAKFQuwabVq-+=Nuaz=0znvzVKAW_TzKFwtdcwrSGXN-bBdt9Gg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: delete taking long time  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-sql


On Tuesday, March 15, 2016, David G. Johnston <david.g.johnston@gmail.com> wrote:
On Tuesday, March 15, 2016, Andreas Kretschmer <andreas@a-kretschmer.de> wrote:

>
> I am trying to delete the connections with date 2016-03-10 by using the
> following:
>
>
> delete from connection where uid in (select uid from connection where ts >
> '2016-03-10 00:30:00');

try to rewrite that to :

delete from connection where ts > '2016-03-10 00:30:00';

It's simpler - and (maybe) faster.


 
It also gives a different answer...
 

Never mind...the PK makes them equivalent.

David J.
 

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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: delete taking long time
Следующее
От: Andreas Kretschmer
Дата:
Сообщение: Re: delete taking long time