X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id BA725566F1 for ; Tue, 15 Mar 2005 23:38:45 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 66508-09 for ; Tue, 15 Mar 2005 23:38:36 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id B08EC566F0 for ; Tue, 15 Mar 2005 23:38:35 +0000 (GMT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id j2FNcZH2021303 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 15 Mar 2005 16:38:37 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.3/8.13.3) with ESMTP id j2FNcYSt068337; Tue, 15 Mar 2005 16:38:34 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.3/8.13.3/Submit) id j2FNcYLe068336; Tue, 15 Mar 2005 16:38:34 -0700 (MST) (envelope-from mfuhr) Date: Tue, 15 Mar 2005 16:38:34 -0700 From: Michael Fuhr To: David Gagnon Cc: pgsql-performance@postgresql.org Subject: Re: Performance problem on delete from for 10k rows. May takes 20 minutes through JDBC interface Message-ID: <20050315233834.GA68209@winnie.fuhr.org> References: <42375281.9090102@siunik.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42375281.9090102@siunik.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.004 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/309 X-Sequence-Number: 11014 On Tue, Mar 15, 2005 at 04:24:17PM -0500, David Gagnon wrote: > Il get this strange problem when deleting rows from a Java program. > Sometime (For what I noticed it's not all the time) the server take > almost forever to delete rows from table. Do other tables have foreign key references to the table you're deleting from? If so, are there indexes on the foreign key columns? Do you have triggers or rules on the table? Have you queried pg_locks during the long-lasting deletes to see if the deleting transaction is waiting for a lock on something? > I rememeber having tried to delete the content of my table (IC) from > PgAdminIII and I took couples of seconds!!! Not minutes. How many records did you delete in this case? If there are foreign key references, how many records were in the referencing tables? How repeatable is the disparity in delete time? A single test case might have been done under different conditions, so it might not mean much. No offense intended, but "I remember" doesn't carry as much weight as a documented example. -- Michael Fuhr http://www.fuhr.org/~mfuhr/