Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1V1mIR-0008Ik-OL for pgsql-admin@arkaria.postgresql.org; Tue, 23 Jul 2013 23:47:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1V1mIR-0003JC-6U for pgsql-admin@arkaria.postgresql.org; Tue, 23 Jul 2013 23:47:11 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1V1mIQ-0003J5-36 for pgsql-admin@postgresql.org; Tue, 23 Jul 2013 23:47:10 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1V1mIN-0004bn-Bp for pgsql-admin@postgresql.org; Tue, 23 Jul 2013 23:47:09 +0000 Received: from bruce by momjian.us with local (Exim 4.72) (envelope-from ) id 1V1mIM-0006B5-2h; Tue, 23 Jul 2013 19:47:06 -0400 Date: Tue, 23 Jul 2013 19:47:06 -0400 From: Bruce Momjian To: Jerry Sievers Cc: Kevin Grittner , "pgsql-admin@postgresql.org" Subject: Re: Dump/Reload pg_statistic to cut time from pg_upgrade? Message-ID: <20130723234706.GA31462@momjian.us> References: <874nc4yi2b.fsf@comcast.net> <1373465348.51692.YahooMailNeo@web162906.mail.bf1.yahoo.com> <87r4f65sdm.fsf@comcast.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87r4f65sdm.fsf@comcast.net> User-Agent: Mutt/1.5.20 (2009-06-14) X-Pg-Spam-Score: 0.8 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org On Wed, Jul 10, 2013 at 10:47:33AM -0500, Jerry Sievers wrote: > > What I have done in a similar situation, to minimize down time, is > > to run a database ANALYZE with a very small target.  I forget the > > particular value we used -- it may have been 3.  Then ran an > > ANALYZE with the normal default target on a few key tables > > (identified in testing to be the ones eating most of the scan time > > with no statistics), and let users in.  The database ANALYZE with > > the normal default target was done while normal production hit the > > database, without too much of a performance hit.  With this > > technique we were able to let users in with near-normal performance > > with 10 or 15 minutes of down time rather than hours. > > Thanks Kevin! In fact, I've conceived of this solution route already > and may have to resort to it. We do run with > default_statistics_target set fairly high at 1000 (legacy setting > here) without my knowing for certain that it's required across the > board (and most likely is not). > > Curious though if it's known that the pg_statistic table can't be > reloded from it's own pg_dump due to that error that I highlighted in > the original post. > > Agree that being able to manually load pg_statistic is of questionable > usefulness though perhaps viable under the right circumstances. 9.2 already creates an incremental statistics script called analyze_new_cluster.sh: Make pg_upgrade create a script to incrementally generate more accurate optimizer statistics (Bruce Momjian) This reduces the time needed to generate minimal cluster statistics after an upgrade. It runs with a 1/10/default statistics target. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. + -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin