Re: automated row deletion

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: automated row deletion
Date: 2009-10-10 10:12:00
Message-ID: hapmlg$unr$1@reversiblemaps.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2009-10-07, Dave Huber <DHuber(at)letourneautechnologies(dot)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 )

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jasen Betts 2009-10-10 10:20:40 Re: Best data type to use for sales tax percent
Previous Message Scott Marlowe 2009-10-10 07:40:26 Re: Access dynamic NEW.column_name in trigger?