Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YKtxI-0001MT-Lk for pgsql-admin@arkaria.postgresql.org; Mon, 09 Feb 2015 19:25:12 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YKtxH-0005gy-Hp for pgsql-admin@arkaria.postgresql.org; Mon, 09 Feb 2015 19:25:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YKtxG-0005g8-Ok for pgsql-admin@postgresql.org; Mon, 09 Feb 2015 19:25:10 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1YKtxC-0001wV-PF for pgsql-admin@postgresql.org; Mon, 09 Feb 2015 19:25:09 +0000 Received: from bruce by momjian.us with local (Exim 4.72) (envelope-from ) id 1YKtx9-0002Us-8q; Mon, 09 Feb 2015 14:25:03 -0500 Date: Mon, 9 Feb 2015 14:25:03 -0500 From: Bruce Momjian To: "For@ll" Cc: pgsql-admin@postgresql.org Subject: Re: Lost statistics after restore database Message-ID: <20150209192503.GA7072@momjian.us> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-Pg-Spam-Score: -1.9 (-) 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, Feb 4, 2015 at 08:01:15AM +0100, For@ll wrote: > Hi, > > I have weird problem with database postgresql 9.3.5. I tried to use > pg_upgrade to migrate dabase from postgresql 9.2 to 9.3 it ended in > 2 minutes - orginal database has 45GB and after pg_upgrade has > 200MB. > So I used pg_dump (9.3.5) with binary format (Fc) and then restore > with pg_restore 9.3.5. Database did restore but thereis problem with > statistics. I have the same database on the other server and when I > look for statistics I have 75 rows and on my broken db I should have > the same, but I have only 20 rows and there are queries that lasts > and lasts. > If I give explain analyze for them it last for 45 minutes and more... Neither upgrade method preserves optimizer statistics, try ANALYZE. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + Everyone has their own god. + -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin