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

Re: pg_upgrade and statistics

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>,Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>,Daniel Farina <daniel(at)heroku(dot)com>, Greg Stark <stark(at)mit(dot)edu>,pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_upgrade and statistics
Date: 2012-03-14 21:36:22
Message-ID: 20120314213622.GA26534@momjian.us (view raw or flat)
Thread:
Lists: pgsql-hackers
On Wed, Mar 14, 2012 at 10:40:41PM +0200, Peter Eisentraut wrote:
> On tis, 2012-03-13 at 20:34 -0400, Bruce Momjian wrote:
> > I frankly am worried that if we copy over statistics even in ASCII
> > that don't match what the server expects, it might lead to a crash,
> > which has me back to wanting to speed up vacuumdb.
> 
> Why can't we maintain a conversion routine for statistics from older
> versions?  It's not like the statistics layout changes every week.
> pg_dump could print out something like
> 
> SELECT pg_restore_statistics(catversion, tablename, ... some data ...);
> ...
> 
> and that function would have the knowledge to convert the data and
> insert it back into pg_statistic and pg_class.
> 
> That can't be that hard considering all the other work we put into
> backward compatibility and upgrade capability.

Well, I have not had to make major adjustments to pg_upgrade since 9.0,
meaning the code is almost complete unchanged and does not require
additional testing for each major release.  If we go down the road of
dumping stats, we will need to adjust for stats changes and test this to
make sure we have made the proper adjustment for every major release.

-- 
  Bruce Momjian  <bruce(at)momjian(dot)us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

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

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2012-03-14 21:38:12
Subject: Re: CREATE FOREGIN TABLE LACUNA
Previous:From: Dimitri FontaineDate: 2012-03-14 21:33:28
Subject: Re: Command Triggers, patch v11

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