Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 88F09475AEB for ; Mon, 26 Aug 2002 15:49:31 -0400 (EDT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id 16DE1475A3F for ; Mon, 26 Aug 2002 15:49:28 -0400 (EDT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 7C418D5FA; Mon, 26 Aug 2002 12:49:27 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 67EAE5C02; Mon, 26 Aug 2002 12:49:27 -0700 (PDT) Date: Mon, 26 Aug 2002 12:49:27 -0700 (PDT) From: Stephan Szabo To: Vilson farias Cc: Subject: Re: Deleting large amount of data. In-Reply-To: <00ee01c24d36$7246a3c0$98a0a8c0@dgtac> Message-ID: <20020826124628.C64199-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/308 X-Sequence-Number: 5422 On Mon, 26 Aug 2002, Vilson farias wrote: > Greetings, > > I'm having some perfomance problems related with large amount of > tuples in a table, so I decided to start programming some shell > scripts to be placed in crontad to remove old data every night. Hmm, you might want to send some info on the schema/queries/explain output, maybe someone'll be able to help. > > Now, my questions are : > > If I just execute a DELETE * FROM WHERE call_start < '2002-08-21' > and call_start > '2002-08-20', and that interval has 100.000 tuples, > does DELETE start and commit a transaction for every single deletion? No. It's all one statement, so it'll be in its containing transaction (if you haven't started one, it'll be put into its own).