X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id AA8FFD1CAF3 for ; Tue, 24 Feb 2004 02:58:00 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 51108-01 for ; Mon, 23 Feb 2004 22:58:02 -0400 (AST) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 22349D1BABF for ; Mon, 23 Feb 2004 22:57:58 -0400 (AST) Received: (qmail 21837 invoked by uid 500); 24 Feb 2004 03:00:17 -0000 Date: Mon, 23 Feb 2004 21:00:17 -0600 From: Bruno Wolff III To: "Ed L." Cc: pgsql-performance@postgresql.org Subject: Re: [PERFORMANCE] slow small delete on large table Message-ID: <20040224030017.GA2872@wolff.to> Mail-Followup-To: "Ed L." , pgsql-performance@postgresql.org References: <200402231910.57078.pgsql@bluepolka.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200402231910.57078.pgsql@bluepolka.net> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/272 X-Sequence-Number: 5796 On Mon, Feb 23, 2004 at 19:10:57 -0700, "Ed L." wrote: > > A 7.3.4 question... > > I want to "expire" some data after 90 days, but not delete too > much at once so as not to overwhelm a system with precariously > balanced disk I/O and on a table with millions of rows. If I > could say it the way I think for a simple example, it'd be > like this: If there aren't foreign keys into the table from which rows are being deleted, then a delete shouldn't have a big impact on the system. If you do the expires frequently, then there won't be as many records to delete at one time. The other response showed you how to avoid the sequential scan, which is the other part of the problem.