pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rajesh Kumar Mallah <mallah@trade-india.com>
To: josh@agliodbs.com, Kyle <kyle@ccidomain.com>
To: Forum - PostGreSQL SQL <pgsql-sql@postgresql.org>
Subject: Re: Best way to delete time stamped data?
Date: Mon, 5 May 2003 15:26:21 +0530
Message-ID: <200305051526.21885.mallah@trade-india.com> (raw)
In-Reply-To: <200305021619.41879.josh@agliodbs.com>
References: <3EB2EBF0.8010003@ccidomain.com>
	<200305021619.41879.josh@agliodbs.com>



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.




view thread (8+ messages)  latest in thread

Message-ID: <200305051526.21885.mallah@trade-india.com>
Permalink:  ../200305051526.21885.mallah@trade-india.com/
Also on:    postgresql.org/message-id/200305051526.21885.mallah@trade-india.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mallah@trade-india.com, kyle@ccidomain.com
  Subject: Re: Best way to delete time stamped data?
  In-Reply-To: <200305051526.21885.mallah@trade-india.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox