Re: Best way to delete time stamped data?

From: Rajesh Kumar Mallah <mallah(at)trade-india(dot)com>
To: josh(at)agliodbs(dot)com, Kyle <kyle(at)ccidomain(dot)com>, Forum - PostGreSQL SQL <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Best way to delete time stamped data?
Date: 2003-05-05 09:56:21
Message-ID: 200305051526.21885.mallah@trade-india.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

an index on age(date(trxdate)) would make it faster ?

regds
mallah.

On Saturday 03 May 2003 4:49 am, Josh Berkus wrote:
> Kyle,
>
> > DELETE FROM ONLY richtable WHERE trxdate < current_timestamp - interval
> > '90 days';
> >
> > This works great. But I was wondering if there is a better or more
> > compact way to go about it. (this method feels "clunky" to me)
>
> More compact than that ?!?!?!
> Maybe you should go into Perl, instead of SQL -- I think the one-liners
> would suit you.
>
> You can use the age() function, but all that funciton does is the same
> calculation you have above.

--
Rajesh Kumar Mallah,
Project Manager (Development)
Infocom Network Limited, New Delhi
phone: +91(11)6152172 (221) (L) ,9811255597 (M)

Visit http://www.trade-india.com ,
India's Leading B2B eMarketplace.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Nigel J. Andrews 2003-05-05 11:08:19 Re: Database server restarting
Previous Message Martijn van Oosterhout 2003-05-05 09:34:33 Re: problems restoring 7.2.1 dump to 7.3.2

Browse pgsql-sql by date

  From Date Subject
Next Message Reiner Dassing 2003-05-05 12:16:27 Indices are not used by the optimizer
Previous Message Jean-Luc Lachance 2003-05-04 17:12:19 Re: [SQL] Best way to delete time stamped data?