X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 088529FA278 for ; Fri, 19 May 2006 17:50:25 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 20322-04 for ; Fri, 19 May 2006 17:50:18 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id B6AD09FA22C for ; Fri, 19 May 2006 17:50:18 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id 2DB6E56423; Fri, 19 May 2006 15:50:17 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Fri, 19 May 2006 15:50:15 -0500 Date: Fri, 19 May 2006 15:50:14 -0500 From: "Jim C. Nasby" To: Chris Mckenzie Cc: pgsql-performance@postgresql.org Subject: Re: Performance/Maintenance test result collection Message-ID: <20060519205013.GN64371@pervasive.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.11 X-Hashcash: 1:20:060519:chris.mckenzie@entrust.com::cjQx9dmwRgwbqmqA:00000000000 0000000000000000000000005A+1 X-Hashcash: 1:20:060519:pgsql-performance@postgresql.org::C12yTbL4nIC1z9At:00000 000000000000000000000000Ak/D X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/405 X-Sequence-Number: 19192 On Thu, May 18, 2006 at 11:20:17AM -0400, Chris Mckenzie wrote: > Yes, regular versus full vacuum. Thanks for the comment but I was hoping to > come to that conclusion on my own by observing the affects of the different > vacuums. > > My original question was guidance on collecting data for confirmation on the > impact that maintenance of a large database (as a result of my applications > regular usage over a period of time) has. > > I can du the various tables and compare their size before/after against the > verbose output of a VACUUM FULL. I can use sar during all of this to monitor > cpu and i/o activity. I can turn on transaction logging once I get a better > idea of maintenance impact on my hardware so identify the biggest > transactions that might statement timeout if a VACUUM was running at the > same time. Well, vacuum full re-writes the table completely from scratch. Lazy vacuum reads the entire table (just like full), but only writes out pages that have dead space on them. But if you're wondering about the impact that will have on your application, you can stop wondering, because vacuum full will essentially shut your application down because it locks out use of the table while it's being vacuumed. > Any suggestions or comments related to collection of this type of data would > be helpful. I've already read the Postges 7.4 (yes, I'm stuck on 7.4) > manual, I was hoping for this mail-list' wisdom to supply me with some tips > that can only be learnt through painful experience. :-) If you're stuck on 7.4, at least make sure you're using the most recent version. Otherwise you're exposing yourself to a number of data loss bugs. As for vacuuming, it depends a lot on what your application is doing. If you have frequent-enough slow periods (like at night), you can probably schedule a database-wide vacuum during that time, possibly supplimented by vacuums on critical tables during the day. If you have something closer to a 24x7 load then pg_autovacuum is probably your best bet, along with vacuum_cost_delay (if that's available in 7.4; it's been so long I don't remember). There's a few articles in our knowledge base (http://www.pervasivepostgres.com/kb/index.asp) that might be worth reading as well (search for 'vacuum'). In particular, "Is PostgreSQL remembering what I vacuumed" has some critical information about managing the free space map. -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461