pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: For@ll <forall@stalowka.info>
Cc: pgsql-admin@postgresql.org
Subject: Re: Lost statistics after restore database
Date: Mon, 9 Feb 2015 14:25:03 -0500
Message-ID: <20150209192503.GA7072@momjian.us> (raw)
In-Reply-To: <masg3r$fqu$1@ger.gmane.org>
References: <masg3r$fqu$1@ger.gmane.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

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  <bruce@momjian.us>        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



view thread (3+ messages)  latest in thread

Message-ID: <20150209192503.GA7072@momjian.us>
Permalink:  ../20150209192503.GA7072@momjian.us/
Also on:    postgresql.org/message-id/20150209192503.GA7072@momjian.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: bruce@momjian.us, forall@stalowka.info
  Subject: Re: Lost statistics after restore database
  In-Reply-To: <20150209192503.GA7072@momjian.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox