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

Re: pg_upgrade and statistics

From: Greg Stark <stark(at)mit(dot)edu>
To: Daniel Farina <daniel(at)heroku(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_upgrade and statistics
Date: 2012-03-13 17:46:06
Message-ID: CAM-w4HO4tmF16BApEotvFKViW4X0j=Et7sssZeKs+pnZwdU55w@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Tue, Mar 13, 2012 at 1:38 AM, Daniel Farina <daniel(at)heroku(dot)com> wrote:
> You probably are going to ask: "why not just run ANALYZE and be done
> with it?"

Uhm yes. If analyze takes a long time then something is broken. It's
only reading a sample which should be pretty much a fixed number of
pages per table. It shouldn't take much longer on your large database
than on your smaller databases.

Perhaps you're running vacuum analyze by mistake?

If Analyze is taking a long time then we're getting the worst of both
worlds. The statistics are very poor for certain metrics (namely
ndistinct). The main reason we don't do better is because we don't
want to do a full scan.


-- 
greg

In response to

Responses

pgsql-hackers by date

Next:From: Robert HaasDate: 2012-03-13 17:46:24
Subject: Re: foreign key locks, 2nd attempt
Previous:From: Alvaro HerreraDate: 2012-03-13 17:35:02
Subject: Re: foreign key locks, 2nd attempt

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