Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 70E5D6381E6 for ; Tue, 16 Mar 2010 14:24:54 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 58410-02 for ; Tue, 16 Mar 2010 17:24:43 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mx3.uci.cu (ns3.uci.cu [200.55.140.180]) by mail.postgresql.org (Postfix) with SMTP id 33C2D6360AC for ; Tue, 16 Mar 2010 14:24:41 -0300 (ADT) Received: (qmail 4248 invoked by uid 507); 16 Mar 2010 17:24:37 -0000 Received: from 10.0.0.183 by ns3.uci.cu (envelope-from , uid 501) with qmail-scanner-2.01st (avp: 5.0.2.0. spamassassin: 3.0.6. perlscan: 2.01st. Clear:RC:1(10.0.0.183):. Processed in 0.671392 secs); 16 Mar 2010 17:24:37 -0000 Received: from unknown (HELO ucimail2.uci.cu) (10.0.0.183) by 0 with SMTP; 16 Mar 2010 17:24:37 -0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by ucimail2.uci.cu (Postfix) with ESMTP id 4AD743DC02B; Tue, 16 Mar 2010 13:24:37 -0400 (CDT) X-Virus-Scanned: amavisd-new at uci.cu Received: from ucimail2.uci.cu ([127.0.0.1]) by localhost (ucimail2.uci.cu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nSmglcPQQ9Gp; Tue, 16 Mar 2010 13:24:33 -0400 (CDT) Received: from [10.36.18.44] (unknown [10.36.18.44]) by ucimail2.uci.cu (Postfix) with ESMTP id C42083DC022; Tue, 16 Mar 2010 13:24:33 -0400 (CDT) Message-ID: <4B9FBFEB.5060503@uci.cu> Date: Tue, 16 Mar 2010 13:29:15 -0400 From: "Ing. Marcos Ortiz Valmaseda" User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Meena_Ramkumar CC: pgsql-performance@postgresql.org Subject: Re: Postgres DB maintainenance - vacuum and reindex References: <27913694.post@talk.nabble.com> In-Reply-To: <27913694.post@talk.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201003/174 X-Sequence-Number: 37999 Meena_Ramkumar escribió: > How to run vacuumdb and reindex for Postgres DB in a non-stop server? Will it > be made without shutting the server? If so, then what will be performance > degradation percentage? > To execute vacuum, you can´t stop the server, is another process of it. If you are using a recent version of PostgreSQL, you can use autovacuum on the server and this process is charged of this or to use VACUUM with the right schedule. You should avoid to use VACUUM FULL, because is very slow and it requires exclusive locks of the tables that you are executing this, and it reduces the table size on the disc but It doesn´t reduce the index size, but iit can make indexes larger. With autovacuum = on, you can avoid to use VACUUM frecuently The performance degradation depends of the quantity of tables and databases that you have on your server. REINDEX is another task that you can execute periodicly on you server, but if you don´t want to affect the production task, the best thing yo do is to drop the index and reissue the CREATE INDEX CONCURRENTLY command. Regards -- -------------------------------------------------------- -- Ing. Marcos Luís Ortíz Valmaseda -- -- Twitter: http://twitter.com/@marcosluis2186 -- -- FreeBSD Fan/User -- -- http://www.freebsd.org/es -- -- Linux User # 418229 -- -- Database Architect/Administrator -- -- PostgreSQL RDBMS -- -- http://www.postgresql.org -- -- http://planetpostgresql.org -- -- http://www.postgresql-es.org -- -------------------------------------------------------- -- Data WareHouse -- Business Intelligence Apprentice -- -- http://www.tdwi.org -- -------------------------------------------------------- -- Ruby on Rails Fan/Developer -- -- http://rubyonrails.org -- -------------------------------------------------------- Comunidad Técnica Cubana de PostgreSQL http://postgresql.uci.cu http://personas.grm.uci.cu/+marcos Centro de Tecnologías de Gestión de Datos (DATEC) Contacto: Correo: centalad@uci.cu Telf: +53 07-837-3737 +53 07-837-3714 Universidad de las Ciencias Informáticas http://www.uci.cu