Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UwGze-00035B-On for pgsql-admin@arkaria.postgresql.org; Mon, 08 Jul 2013 19:21:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1UwGze-0000Dh-6n for pgsql-admin@arkaria.postgresql.org; Mon, 08 Jul 2013 19:21:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UwGzd-0000Db-CV for pgsql-admin@postgresql.org; Mon, 08 Jul 2013 19:21:01 +0000 Received: from qmta04.emeryville.ca.mail.comcast.net ([2001:558:fe2d:43:76:96:30:40]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UwGzZ-0005EB-TY for pgsql-admin@postgresql.org; Mon, 08 Jul 2013 19:21:01 +0000 Received: from omta07.emeryville.ca.mail.comcast.net ([76.96.30.59]) by qmta04.emeryville.ca.mail.comcast.net with comcast id xtw91l0061GXsucA4vLuEA; Mon, 08 Jul 2013 19:20:54 +0000 Received: from homie ([38.98.177.132]) by omta07.emeryville.ca.mail.comcast.net with comcast id xvLk1l00U2rmZlA8UvLnM0; Mon, 08 Jul 2013 19:20:52 +0000 Received: by homie (Postfix, from userid 1000) id 46458180832; Mon, 8 Jul 2013 15:20:44 -0400 (EDT) To: pgsql-admin@postgresql.org Subject: Dump/Reload pg_statistic to cut time from pg_upgrade? From: Jerry Sievers Date: Mon, 08 Jul 2013 14:20:44 -0500 Message-ID: <874nc4yi2b.fsf@comcast.net> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1373311254; bh=/fFLX+dJuVNDQByvbMFDcHCBak44C+juGc+hSug50Y8=; h=Received:Received:Received:To:Subject:From:Date:Message-ID: MIME-Version:Content-Type; b=Ox0kMhnTX0AZdiMb/RjebHmlNUUFht/joeVQgoCQCFmoFIMJHxBV50FaFhK0UpK/3 Cv5En7Z+HSCjcoTZd/U2LtcPnCzd0RV/09qWsfNIaIkPT6+BFOvyS7obsiu8D7R0aZ kteyVWCMW2MOhyKRnAKdjt+iqeyQ16mA9W7I0Sz0ptJ7S7BPqNhOxYJPLlxmVuplrR xLNaiembhR9iikHNSdnWHRiJmOazRTSUjvgWd7bAB6Vt9OfRuDibapZqtzLzLSppcj 13pDQDBIIgt+dgOsxbLZ6VTt7kUbLBvsyY2gwTaABfvloECl2lCUv2iPtIDCSDIJzj DW76+kAm3oHjA== X-Pg-Spam-Score: -1.1 (-) 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 Admins; Planning to pg_upgrade some large (3TB) clusters using hard link method. Run time for the upgrade itself takes around 5 minutes. Nice!! Origin version 8.4 and destination version 9.1. Unfortunately the post-upgrade analyze of the entire cluster is going to take a minimum of 1.5 hours running several threads to analyze all tables. This was measured in an R&D environment. Got to thinking, what if we make a SAN snapshot a few hours prior to upgrade time, upgrade that... then analyze it and then dump the stats table? The assumption is that the DB will not have churned very much between then and when the real upgrade is performed and the stats saved from a few hours earlier might be good enough to go live with. Once the real upgrade is done we'd populate the stats table of it using the saved stats. I realize that there may be rows in the reloaded stats table corresponding to temporary objects that may not exist then, and would have to deal with same. I'd immediately begin analyzing the tables as to have the best stats once this is complete but being able to turn out a working production instance in like 10 minutes rather than 2 hours is the goal here. Anyway, perhaps there are other good reasons I should *not* attempt this but it turns out that the stats table can't be reloaded with it's own dump so this of course is a show-stopper. psql:d:456: ERROR: cannot accept a value of type anyarray CONTEXT: COPY pg_statistic, line 1, column stavalues1: "{_assets,_income,_liabilities,assets,income,liabilities}" Setting allow_system_table_mods to 'on' is required also prior to attempting the import. Has anyone else attempted anything similar? Any feedback is appreciated. Thanks -- Jerry Sievers Postgres DBA/Development Consulting e: postgres.consulting@comcast.net p: 312.241.7800 -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin