Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 715A39FBEC8 for ; Fri, 24 Nov 2006 15:26:46 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 90087-01-8 for ; Fri, 24 Nov 2006 15:26:42 -0400 (AST) X-Greylist: delayed 00:25:50.325311 by SQLgrey-1.7.4 Received: from fafnir.androme.com (fafnir.androme.com [62.58.96.158]) by postgresql.org (Postfix) with ESMTP id 256E19FBEDE for ; Fri, 24 Nov 2006 15:09:30 -0400 (AST) Received: by fafnir.androme.com (Postfix, from userid 1003) id C5903B97ECF; Fri, 24 Nov 2006 19:43:37 +0100 (CET) Message-ID: <45673D56.10707@andromeiberica.com> Date: Fri, 24 Nov 2006 19:43:34 +0100 From: Arnau Reply-To: arnaulist@andromeiberica.com User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Massive delete of rows, how to proceed? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/213 X-Sequence-Number: 21983 Hi all, I have a table with statistics with more than 15 million rows. I'd like to delete the oldest statistics and this can be about 7 million rows. Which method would you recommend me to do this? I'd be also interested in calculate some kind of statistics about these deleted rows, like how many rows have been deleted for date. I was thinking in creating a function, any recommendations? Thank you very much -- Arnau