Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 2C49C9FB569 for ; Mon, 19 Feb 2007 14:05:30 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 94920-09 for ; Mon, 19 Feb 2007 14:05:25 -0400 (AST) X-Greylist: delayed 00:06:41.195923 by SQLgrey-1.7.4 Received: from 66-226-76-106.dedicated.abac.net (66-226-76-106.dedicated.abac.net [66.226.76.106]) by postgresql.org (Postfix) with ESMTP id 92B739FB75C for ; Mon, 19 Feb 2007 14:05:25 -0400 (AST) Received: (qmail 2926 invoked by uid 2020); 19 Feb 2007 09:58:43 -0800 Received: from wsip-70-167-125-69.sd.sd.cox.net (HELO ?192.168.0.3?) (70.167.125.69) by 192.168.0.4 with (DHE-RSA-AES256-SHA encrypted) SMTP; 19 Feb 2007 09:58:43 -0800 Message-ID: <45D9E646.6060909@modgraph-usa.com> Date: Mon, 19 Feb 2007 10:02:46 -0800 From: "Craig A. James" User-Agent: Thunderbird 1.5.0.9 (X11/20061206) MIME-Version: 1.0 To: Andreas Tille CC: pgsql-performance@postgresql.org Subject: Re: How to debug performance problems References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=3.819 tagged_above=0 required=5 tests=BAYES_50, HELO_DYNAMIC_IPADDR2 X-Spam-Level: *** X-Archive-Number: 200702/194 X-Sequence-Number: 23248 Andreas Tille wrote: > My web application was running fine for years without any problem > and the performance was satisfying. Some months ago I added a > table containing 4500000 data rows ... > > Since about two weeks the application became *drastically* slower > and I urgently have to bring back the old performance. As I said > I'm talking about functions accessing tables that did not increased > over several years and should behave more or less the same. Don't assume that the big table you added is the source of the problem. It might be, but more likely it's something else entirely. You indicated that the problem didn't coincide with creating the large table. There are a number of recurring themes on this discussion group: * A long-running transaction keeps vacuum from working. * A table grows just enough to pass a threshold in the planner and a drastically different plan is generated. * An index has become bloated and/or corrupted, and you need to run the REINDEX command. And several other common problems. The first thing is to find out which query is taking a lot of time. I'm no expert, but there have been several explanations on this forum recently how to find your top time-consuming queries. Once you find them, then EXPLAIN ANALYZE should get you started Craig