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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-hackers by date

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