X-Original-To: pgsql-admin@postgresql.org Received: from localhost (unknown [64.117.224.193]) by developer.postgresql.org (Postfix) with ESMTP id DFE489260F7 for ; Thu, 22 May 2003 10:20:57 -0400 (EDT) Received: from developer.postgresql.org ([64.117.224.193]) by localhost (developer.postgresql.org [64.117.224.193:10024]) (amavisd-new) with ESMTP id 35082-01 for ; Thu, 22 May 2003 10:20:26 -0400 (EDT) Received: from localhost.localdomain (unknown [65.217.53.66]) by developer.postgresql.org (Postfix) with ESMTP id 5967C926196 for ; Thu, 22 May 2003 10:02:33 -0400 (EDT) Received: from thorn.mmrd.com (thorn.mmrd.com [172.25.10.100]) by localhost.localdomain (8.12.8/8.12.8) with ESMTP id h4MEoWM3001444; Thu, 22 May 2003 10:50:32 -0400 Received: from gnvex001.mmrd.com (gnvex001.mmrd.com [192.168.3.55]) by thorn.mmrd.com (8.11.6/8.11.6) with ESMTP id h4ME1wL07272; Thu, 22 May 2003 10:01:59 -0400 Received: from camel.mmrd.com ([172.25.5.213]) by gnvex001.mmrd.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id 2YCPZ8GW; Thu, 22 May 2003 10:01:57 -0400 Subject: Re: Full vacuuming of BIG tables takes too long From: Robert Treat To: "Eugene M. Zheganin" Cc: pgsql-admin@postgresql.org In-Reply-To: <94981743421.20030522183701@norma.perm.ru> References: <54953117843.20030522103956@norma.perm.ru> <3ECCB856.C3DB2926@BULL.NET> <94981743421.20030522183701@norma.perm.ru> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.8 Date: 22 May 2003 10:01:58 -0400 Message-Id: <1053612118.2206.323.camel@camel> Mime-Version: 1.0 X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/298 X-Sequence-Number: 8860 On Thu, 2003-05-22 at 08:37, Eugene M. Zheganin wrote: My first suggestion would be to check your free space map settings in the postgresql.conf and make sure they are set high enough. Setting them to low can cause Vacuum Full to take longer than necessary. > Thursday, May 22, 2003, 5:45:26 PM, you wrote: > TM> 2) In the alternative dump/recreate/restore, do you recreate the Foreign Key > TM> ? This step takes long time (depending of your Database schema). I have try > TM> this scenario : > TM> Dump data / Drop Foreign Key / Truuncate Tables / restore / Recreate the > TM> Foreign Key > TM> The step Recreate FK takes 2 times the four first steps. > I don't use foreign keys. Only primary keys. There is only 3 tables in > that db. 99% of space is taken by one table. > Is it possible for you do Begin; Create Table t2 As Select * From t1; Drop Table t1 ; Alter table t2 Rename To t1; Commit; Note you might want to lock t1 from writers, but people could still select from it while you making the switch. Robert Treat