X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 08AEAD6EB0 for ; Sat, 24 Sep 2005 08:28:40 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 97908-03 for ; Sat, 24 Sep 2005 11:28:36 +0000 (GMT) Received: from 217-20-115-93.internetserviceteam.com (217-20-115-93.internetserviceteam.com [217.20.115.93]) by svr1.postgresql.org (Postfix) with ESMTP id 7406BD6DA1 for ; Sat, 24 Sep 2005 08:28:38 -0300 (ADT) Received: from [192.168.1.48] (103.Red-81-44-2.dynamicIP.rima-tde.net [81.44.2.103]) by 217-20-115-93.internetserviceteam.com (Postfix) with ESMTP id 2DDEB39BE8; Sat, 24 Sep 2005 12:44:44 +0200 (CEST) Message-ID: <4335386D.4070105@mediaroot.de> Date: Sat, 24 Sep 2005 12:28:45 +0100 From: Aldor User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Ilya A. Kovalenko" Cc: pgsql-sql@postgresql.org Subject: Re: VACUUM FULL vs dump & restore References: <1981474048079.20050924125612@oganer.net> In-Reply-To: <1981474048079.20050924125612@oganer.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 required=5 tests=[none] X-Spam-Level: X-Archive-Number: 200509/242 X-Sequence-Number: 22789 Another way how to do it with having access to the data in the same time is to create a new table, named a little bit differently and do an: insert into [table]2 select * from [table]; Then switch to the second table. Then you have to do on the first table the TRUNCATE and DROP. For getting out which table is the actual one you can create a table which holds the originate table name and the actual table name. When using plpgsql you can check the table name before building the queries and then build them with EXECUTE. Be aware that you cannot do: SELECT col1, col2 FROM gettablename('[table]'); Also be aware to switch back when you do the process again, so you dump the data from the [table]2 to [table]. For my experience this way was faster then dump-truncate-restore on the table. Regards, Aldor Ilya A. Kovalenko wrote: > Greetings, > > What advantages I lose, when using dump-truncate-restore (table > or whole DB) instead of performing VACUUM FULL ? > In both cases I have no access to data, but first is much faster > (by subjective estimate). > > Thank you, > > Ilya A. Kovalenko (mailto:shadow@oganer.net) > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Have you searched our list archives? > > http://archives.postgresql.org >