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

Re: pg_upgrade and statistics

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Daniel Farina <daniel(at)heroku(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_upgrade and statistics
Date: 2012-03-13 15:08:41
Message-ID: 1331651261-sup-7920@alvh.no-ip.org (view raw or flat)
Thread:
Lists: pgsql-hackers
Excerpts from Bruce Momjian's message of mar mar 13 11:49:26 -0300 2012:
> 
> On Tue, Mar 13, 2012 at 11:34:16AM -0300, Alvaro Herrera wrote:
> > 
> > Excerpts from Bruce Momjian's message of mar mar 13 11:14:43 -0300 2012:
> > > On Tue, Mar 13, 2012 at 12:33:09AM -0700, Daniel Farina wrote:
> > > > On Mon, Mar 12, 2012 at 8:10 PM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> > > > > To answer your specific question, I think clearing the last analyzed
> > > > > fields should cause autovacuum to run on analyze those tables.  What I
> > > > > don't know is whether not clearing the last vacuum datetime will cause
> > > > > the table not to be analyzed.
> > > > 
> > > > Thank you very much for this reference.  I will look into it.
> > > 
> > > I assume a missing last_analyze would trigger an auto-analyze,
> > 
> > You're wrong.  Autovacuum does not consider time, only dead/live tuple
> > counts.  The formulas it uses are in the autovacuum docs; some details
> > (such as the fact that it skips tables that do not have stat entries)
> > might be missing.
> 
> Oh, yes.  Thank you for the correction;  not sure what I was thinking.
> 
> How would they trigger an autovacuum then?

We don't have any mechanism to trigger it currently.  Maybe we could
inject fake messages to the stats collector so that it'd believe the
tables have lots of new tuples and an analyze is necessary.

-- 
Álvaro Herrera <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

pgsql-hackers by date

Next:From: Kevin GrittnerDate: 2012-03-13 15:11:16
Subject: Re: subselect in the column list
Previous:From: Bruce MomjianDate: 2012-03-13 14:49:26
Subject: Re: pg_upgrade and statistics

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