X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id B68FC9DC870 for ; Tue, 17 Jan 2006 11:19:46 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 65580-08 for ; Tue, 17 Jan 2006 11:19:51 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from r1.mycybernet.net (r1.mycybernet.net [209.5.206.8]) by postgresql.org (Postfix) with ESMTP id 85E029DC81E for ; Tue, 17 Jan 2006 11:19:44 -0400 (AST) Received: from 227-54-222-209.mycybernet.net ([209.222.54.227]:34757 helo=phlogiston.dydns.org) by r1.mycybernet.net with esmtp (Exim 4.50 (FreeBSD)) id 1Eyscf-000Ccy-8N for pgsql-performance@postgresql.org; Tue, 17 Jan 2006 10:19:49 -0500 Received: by phlogiston.dydns.org (Postfix, from userid 1000) id 01B494069; Tue, 17 Jan 2006 10:19:44 -0500 (EST) Date: Tue, 17 Jan 2006 10:19:44 -0500 From: Andrew Sullivan To: pgsql-performance@postgresql.org Subject: Re: Autovacuum / full vacuum Message-ID: <20060117151944.GI21092@phlogiston.dyndns.org> References: <20060117145649.GE21092@phlogiston.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.083 required=5 tests=[AWL=0.083] X-Spam-Score: 0.083 X-Spam-Level: X-Archive-Number: 200601/244 X-Sequence-Number: 16722 On Tue, Jan 17, 2006 at 04:04:41PM +0100, Michael Riess wrote: > > I thought that vacuum full only locks the table which it currently > operates on? I'm pretty sure that once a table has been vacuumed, it can > be accessed without any restrictions while the vacuum process works on > the next table. Yes, I think the way I phrased it was unfortunate. But if you issue VACUUM FULL you'll get an exclusive lock on everything, although not all at the same time. But of course, if your query load is like this BEGIN; SELECT from t1, t2 where t1.col1 = t2.col2; [application logic] UPDATE t3 . . . COMMIT; you'll find yourself blocked in the first statement on both t1 and t2; and then on t3 as well. You sure don't want that to happen automagically, in the middle of your business day. > I have 5000 tables and a workstation with 1 GB RAM which hosts an Apache > Web Server, Tomcat Servlet Container and PostgreSQL. RAM is not > something that I have plenty of ... and the hardware is fixed and cannot > be changed. I see. Well, I humbly submit that your problem is not the design of the PostgreSQL server, then. "The hardware is fixed and cannot be changed," is the first optimisation I'd make. Heck, I gave away a box to charity only two weeks ago that would solve your problem better than automatically issuing VACUUM FULL. A -- Andrew Sullivan | ajs@crankycanuck.ca Information security isn't a technological problem. It's an economics problem. --Bruce Schneier