Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id A7B349FB581 for ; Mon, 5 Mar 2007 10:44:40 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 46213-07 for ; Mon, 5 Mar 2007 10:44:37 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.190]) by postgresql.org (Postfix) with ESMTP id CBE129FB521 for ; Mon, 5 Mar 2007 10:44:36 -0400 (AST) Received: by nf-out-0910.google.com with SMTP id x4so2125370nfb for ; Mon, 05 Mar 2007 06:44:34 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=X/Gz6vAFJCM9RK/Crcwe+UBJClgqeN0RpAVf45GsCSNwec4GhtBm1+jnsF5fCH+QQ52QDQRbw5QQcHZ1tRXA5DqlzoqVV4DUEHKi5FGysGOhoERzUejxaQAn7SVPwTh9OYafwk7d1zTFD4d7QmRTlBB1Dm1OBu0zGLO7o9CBad4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=ch9YyKpSjwJ2DFa40MUp/dox7gXuaRihPxSHG3QQy/ynEavmWqMeeALBFnzF4A/eXbKRKoQavNZ+LKPSwyJBla4KcuCOZ4WAmAw6KvwdsTfgm+T3vZa0u0Q/6MzrWg51C8xqW9tnYASqXAEMuPA6sBY6ng/iX1NAvtRBDtYS6EY= Received: by 10.82.116.15 with SMTP id o15mr5162174buc.1173105874498; Mon, 05 Mar 2007 06:44:34 -0800 (PST) Received: from ?192.168.1.34? ( [81.107.202.67]) by mx.google.com with ESMTP id c22sm14521536ika.2007.03.05.06.44.32; Mon, 05 Mar 2007 06:44:33 -0800 (PST) Message-ID: <45EC2CCF.8020906@enterprisedb.com> Date: Mon, 05 Mar 2007 14:44:31 +0000 From: Heikki Linnakangas User-Agent: Icedove 1.5.0.8 (X11/20061116) MIME-Version: 1.0 To: Bruce McAlister CC: pgsql-performance@postgresql.org Subject: Re: PostgreSQL 8.2.3 VACUUM Timings/Performance References: <45EC1931.3020701@enterprisedb.com> 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=0.005 tagged_above=0 required=5 tests=AWL, BAYES_50, SPF_PASS X-Spam-Level: X-Archive-Number: 200703/88 X-Sequence-Number: 23493 Bruce McAlister wrote: > Hi Heikki, > > Thanks for the reply. > > The RAID array was implemented due to a projected growth pattern which > incorporate all 18 of our databases. The sizings I mentioned only refer to 1 > of those databases, which, is also the most heavily used database :) > > If I understand you correctly, we could in essence change our maintenance > routine to the follwing: > > [1] Cluster on most used index > [2] Perform a vacuum analyze on the table > > If I read your post correctly, this will regenerate the index that the > cluster is performed on (1 of 3) and also re-generate the table in the > sequence of that index? That's right. In fact, even cluster probably doesn't make much difference in your case. Since the table fits in memory anyway, the physical order of it doesn't matter much. I believe you would be fine just turning autovacuum on, and not doing any manual maintenance. > If that is the case, why would anyone use the vacuum full approach if they > could use the cluster command on a table/database that will regen these > files for you. It almost seems like the vacuum full approach would, or > could, be obsoleted by the cluster command, especially if the timings in > their respective runs are that different (in our case the vacuum full took > 15 minutes in our worst case, and the cluster command took under 1 second > for the same table and scenario). In fact, getting rid of vacuum full, or changing it to work like cluster, has been proposed in the past. The use case really is pretty narrow; cluster is a lot faster if there's a lot of unused space in the table, and if there's not, vacuum full isn't going to do much so there's not much point running it in the first place. The reason it exists is largely historical, there hasn't been a pressing reason to remove it either. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com