Re: Best way to delete time stamped data? - Mailing list pgsql-sql

From Rajesh Kumar Mallah
Subject Re: Best way to delete time stamped data?
Date
Msg-id 200305051526.21885.mallah@trade-india.com
Whole thread Raw
In response to Re: Best way to delete time stamped data?  (Josh Berkus <josh@agliodbs.com>)
Responses Re: Best way to delete time stamped data?  (Bruno Wolff III <bruno@wolff.to>)
List 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.



pgsql-sql by date:

Previous
From: Rajesh Kumar Mallah
Date:
Subject: Re: timeofday() and now() issue..
Next
From: Reiner Dassing
Date:
Subject: Indices are not used by the optimizer