On 2009-10-07, Dave Huber <dhu...@letourneautechnologies.com> wrote:
> --_000_7CDADB576E07AC4FA71E1B12566C9126540E0A0C34ltimb1LTIcom_
> Content-Type: text/plain; charset="us-ascii"
> Content-Transfer-Encoding: quoted-printable
>
> A colleague gave me the following query to run:
>
> DELETE FROM data_log_20msec_table WHERE (log_id IN (SELECT log_id FROM data=
> _log_20msec_table ORDER BY log_id DESC OFFSET 10000000))

looks slower than neccessary.

DELETE FROM data_log_20msec_table WHERE log_id < (SELECT log_id FROM
data= _log_20msec_table ORDER BY log_id DESC OFFSET 10000000 LIMIT 1 )



-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to