Skip site navigation (1) Skip section navigation (2)

Re: pg_upgrade and statistics

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Daniel Farina <daniel(at)heroku(dot)com>,pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_upgrade and statistics
Date: 2012-03-13 14:10:25
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
On Tue, Mar 13, 2012 at 12:12:27AM -0400, Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > Copying the statistics from the old server is on the pg_upgrade TODO
> > list.  I have avoided it because it will add an additional requirement
> > that will make pg_upgrade more fragile in case of major version changes.
> > Does anyone have a sense of how often we change the statistics data
> > between major versions?
> I don't think pg_statistic is inherently any more stable than any other
> system catalog.  We've whacked it around significantly just last week,
> which might color my perception a bit, but there are other changes on
> the to-do list.  (For one example, see nearby complaints about
> estimating TOAST-related costs, which we could not fix without adding
> more stats data.)

Yes, that was my reaction too.  pg_upgrade has worked hard to avoid
copying any system tables, relying on pg_dump to handle that.  

I just received a sobering blog comment stating that pg_upgrade took 5
minutes on a 0.5TB database, but analyze took over an hour:

Is there some type of intermediate format we could use to dump/restore
the statistics?  Is there an analyze "light" mode we could support that
would run faster?

  Bruce Momjian  <bruce(at)momjian(dot)us>

  + It's impossible for everything to be true. +

In response to


pgsql-hackers by date

Next:From: Pavel StehuleDate: 2012-03-13 14:11:43
Subject: Re: Explicitly specifying use of IN/OUT variable in PL/pgSQL functions
Previous:From: Joel JacobsonDate: 2012-03-13 14:05:25
Subject: Explicitly specifying use of IN/OUT variable in PL/pgSQL functions

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group