Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id E00D69FA19A for ; Mon, 4 Dec 2006 10:37:56 -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 61736-06 for ; Mon, 4 Dec 2006 10:37:37 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from outbound.mailhop.org (outbound.mailhop.org [63.208.196.171]) by postgresql.org (Postfix) with ESMTP id 3D0D49FA2E0 for ; Mon, 4 Dec 2006 10:37:49 -0400 (AST) Received: from ool-435121e8.dyn.optonline.net ([67.81.33.232] helo=[192.168.0.96]) by outbound.mailhop.org with esmtpa (Exim 4.63) (envelope-from ) id 1GrEx1-000Dmo-8L; Mon, 04 Dec 2006 09:37:47 -0500 X-Mail-Handler: MailHop Outbound by DynDNS X-Originating-IP: 67.81.33.232 X-Report-Abuse-To: abuse@dyndns.com (see http://www.mailhop.org/outbound/abuse.html for abuse reporting information) X-MHO-User: tocr Message-ID: <45743240.7050302@zeut.net> Date: Mon, 04 Dec 2006 09:35:44 -0500 From: Matthew O'Connor User-Agent: Thunderbird 2.0a1 (Windows/20060724) MIME-Version: 1.0 To: Carlo Stonebanks CC: pgsql-performance@postgresql.org Subject: Re: Is Vacuum/analyze destroying my performance? 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-Archive-Number: 200612/43 X-Sequence-Number: 22099 Just a wild guess, but the performance problem sounds like maybe as your data changes, eventually the planner moves some query from an index scan to a sequential scan, do you have any details on what queries are taking so long when things are running slow? You can turn on the GUC var "log_min_duration_statement" and see what queries are slow and then manually check them with an explain analyze, that might help. Matt Carlo Stonebanks wrote: > Update on this issue, I "solved" my problem by doing the following: > > 1) Stopped the import, and did a checkpoint backup on my import target > schema > 2) Dropped the import target schema > 3) Restored a backup from a previous checkpoint when the tables were much > smaller > 4) Performed a VACUUM/ANALYZE on all of the tables in the import target > schema in that smaller state > 5) Dropped the import target schema again > 6) Restored the checkpoint backup of the larger data set referred to in step > 1 > 7) Rstarted the import from where it left off > > The result: the import is flying again, with 10-20 times the performance. > The import runs as 4 different TCL scripts in parallel, importing difernt > segments of the table. The problem that I have when the import runs at this > speed is that I hve to constantly watch for lock-ups. Previously I had > reported that when these multiple processes are running at high speed, > PostgreSQL occasionally freezes one or more of the processes by never > retutning from a COMMIT. I look at the target tables, and it seems that the > commit has gone through. > > This used to be a disaster because Ithought I had to restart every frozen > proess by killing the script and restarting at the last imported row. > > Now I have found a way to un-freeze the program: I find the frozen process > via PgAdmin III and send a CANCEL. To my surprise, the import continues as i > nothing happened. Still incredibly inconvenient and laborious, but at least > it's a little less tedious. > > Could these two problems - the weird slowdowns after a VACUUM/ANALYZE and > the frequent lockups when the import process is running quickly - be > related? > > Carlo > > > > ---------------------------(end of broadcast)--------------------------- > TIP 5: don't forget to increase your free space map settings >