Re: delete taking long time - Mailing list pgsql-sql

From David G. Johnston
Subject Re: delete taking long time
Date
Msg-id CAKFQuwabVq-+=Nuaz=0znvzVKAW_TzKFwtdcwrSGXN-bBdt9Gg@mail.gmail.com
Whole thread Raw
In response to Re: delete taking long time  ("David G. Johnston" <david.g.johnston@gmail.com>)
List 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 by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: delete taking long time
Next
From: Andreas Kretschmer
Date:
Subject: Re: delete taking long time