X-Original-To: pgsql-general@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 1D9EB476331 for ; Sun, 4 May 2003 12:30:25 -0400 (EDT) Received: from flake.decibel.org (flake.decibel.org [66.143.173.58]) by postgresql.org (Postfix) with SMTP id 47766475F00 for ; Sun, 4 May 2003 12:30:24 -0400 (EDT) Received: (qmail 55869 invoked by uid 1001); 4 May 2003 16:30:29 -0000 Date: Sun, 4 May 2003 11:30:29 -0500 From: "Jim C. Nasby" To: Kyle Cc: Forum - PostGreSQL General Subject: Re: [SQL] Best way to delete time stamped data? Message-ID: <20030504113029.W66185@flake.decibel.org> Reply-To: jim@nasby.net References: <3EB2EBF0.8010003@ccidomain.com> <200305021619.41879.josh@agliodbs.com> <3EB510F1.8090708@ccidomain.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <3EB510F1.8090708@ccidomain.com>; from kyle@ccidomain.com on Sun, May 04, 2003 at 09:09:05AM -0400 X-Operating-System: FreeBSD 4.8-RELEASE i386 X-Distributed: Join the Effort! http://www.distributed.net X-Spam-Status: No, hits=-35.4 required=5.0 tests=BAYES_10,EMAIL_ATTRIBUTION,IN_REP_TO,REFERENCES, REPLY_WITH_QUOTES,SIGNATURE_SHORT_SPARSE,USER_AGENT_MUTT autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200305/82 X-Sequence-Number: 41737 On Sun, May 04, 2003 at 09:09:05AM -0400, Kyle wrote: > Josh, > > Thanks, even my boss can read the new statement: > > DELETE FROM ONLY richtable WHERE age(trxdate) > '90 days'; Just remember that that query won't use any index on trxdate, because it has to calculate 'age(trxdate)' for every value in the table. -- Jim C. Nasby (aka Decibel!) jim@nasby.net Member: Triangle Fraternity, Sports Car Club of America Give your computer some brain candy! www.distributed.net Team #1828 Windows: "Where do you want to go today?" Linux: "Where do you want to go tomorrow?" FreeBSD: "Are you guys coming, or what?"