Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 48ED51EB83ED for ; Thu, 23 Feb 2012 11:29:17 -0400 (AST) Received: from mh2.mail.rice.edu ([128.42.201.21]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1S0abZ-0000PM-Ba for pgsql-performance@postgresql.org; Thu, 23 Feb 2012 15:29:16 +0000 Received: from mh2.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh2.mail.rice.edu (Postfix) with ESMTP id 24AC8292122; Thu, 23 Feb 2012 09:28:38 -0600 (CST) Received: from mh2.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh2.mail.rice.edu (Postfix) with ESMTP id 10774297607; Thu, 23 Feb 2012 09:28:38 -0600 (CST) X-Virus-Scanned: by amavis-2.6.4 at mh2.mail.rice.edu, auth channel Received: from mh2.mail.rice.edu ([127.0.0.1]) by mh2.mail.rice.edu (mh2.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id 1SJG81n1EPlQ; Thu, 23 Feb 2012 09:28:37 -0600 (CST) X-SMTP-Auth: no X-SMTP-Auth: no X-SMTP-Auth: no X-SMTP-Auth: no Received: from aart.rice.edu (aart.rice.edu [168.7.56.48]) by mh2.mail.rice.edu (Postfix) with ESMTP id C2C73292122; Thu, 23 Feb 2012 09:28:37 -0600 (CST) Received: by aart.rice.edu (Postfix, from userid 18612) id B93521002B8; Thu, 23 Feb 2012 09:28:37 -0600 (CST) Date: Thu, 23 Feb 2012 09:28:37 -0600 From: "ktm@rice.edu" To: "Reuven M. Lerner" Cc: Andrew Dunstan , Marcin =?utf-8?B?TWHFhGs=?= , pgsql-performance@postgresql.org Subject: Re: Very long deletion time on a 200 GB database Message-ID: <20120223152837.GV21114@aart.rice.edu> References: <4F45FB55.1020600@lerner.co.il> <4F464C49.4050503@dunslane.net> <4F465A7A.4000905@lerner.co.il> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F465A7A.4000905@lerner.co.il> User-Agent: Mutt/1.5.20 (2009-12-10) X-Pg-Spam-Score: -4.2 (----) X-Archive-Number: 201202/163 X-Sequence-Number: 46335 On Thu, Feb 23, 2012 at 05:25:46PM +0200, Reuven M. Lerner wrote: > > > >What is the distribution of end_dates? It might be worth running this in > >several steps, deleting records older than, say, 90 days, 60 days, 30 days. > > I've suggested something similar, but was told that we have limited > time to execute the DELETE, and that doing it in stages might not be > possible. > > Reuven > In cases like this, I have often found that doing the delete in smaller pieces goes faster, sometimes much faster, than the bigger delete. Regards, Ken