X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 14FFD52ED7 for ; Tue, 26 Jul 2005 11:29:01 -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 25074-02 for ; Tue, 26 Jul 2005 14:28:59 +0000 (GMT) Received: from matrix.gatewaynet.com (matrix.gatewaynet.com [217.19.69.50]) by svr1.postgresql.org (Postfix) with ESMTP id 7AE6D52EC6 for ; Tue, 26 Jul 2005 11:28:57 -0300 (ADT) Received: from matrix.gatewaynet.com (localhost.localdomain [127.0.0.1]) by matrix.gatewaynet.com (8.12.8/8.12.8) with ESMTP id j6QEHsmj032243; Tue, 26 Jul 2005 17:17:54 +0300 Received: from localhost (achill@localhost) by matrix.gatewaynet.com (8.12.8/8.12.8/Submit) with ESMTP id j6QEHsw6032239; Tue, 26 Jul 2005 17:17:54 +0300 Date: Tue, 26 Jul 2005 17:17:54 +0300 (EEST) From: Achilleus Mantzios To: Christopher Browne Cc: pgsql-sql@postgresql.org Subject: Re: REINDEX DATABASE In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-7 Content-Transfer-Encoding: 8BIT X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.007 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/228 X-Sequence-Number: 22206 O Christopher Browne έγραψε στις Jul 26, 2005 : > > Hello > > > > Would you like to advice to use REINDEX DATABASE on regular basis ? > > > > if (yes) > > how it should be connected with VACUUM FULL ANALYZE which is run > > regularly ? (reindex before vacuum or vacuum before reindex?) > > > > else > > haw to determine _when_ to run REINDEX ? > > If you are doing ordinary VACUUM ANALYZE frequently enough, it > shouldn't be necessary to either VACUUM FULL or REINDEX. > > Back in the 7.2 days, there were sorts of update patterns that would > mandate reindexing every so often, as you could get cases where index > pages would be very sparsely populated. That was alleviated in > version 7.3, I believe, and was clearly evident in 7.4. > > You know you need to REINDEX if analysis of an index shows that it is > sparsely populated. This generally shows up if you do an analyze on > the table and find an index has more pages than tuples. > > But if you run VACUUM reasonably frequently, this shouldn't be > necessary... I vacuum analyze every hour, however after reindexdb my (currently) 2.47 GB db is reduced to 2.37 GB, thus helping both db-wise and freebsd_cache-wise boost performance. All the above in 7.4.6. I am not arguing that i have done detailed analysis of the situation, i'm just saying that i have witnessed a performance gain after running contrib/reindexdb every month (or so). > -- -Achilleus