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

Re: Autoanalyze settings with zero scale factor

From: "Matthew T(dot) O'Connor" <matthew(at)zeut(dot)net>
To: Jeremy Haile <jhaile(at)fastmail(dot)fm>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Autoanalyze settings with zero scale factor
Date: 2007-01-18 19:20:11
Message-ID: 45AFC86B.9010704@zeut.net (view raw or flat)
Thread:
Lists: pgsql-performance
Jeremy Haile wrote:
> I changed the table-specific settings so that the ANALYZE base threshold
> was 5000 and the ANALYZE scale factor is 0.  According to the documented
> formula: analyze threshold = analyze base threshold + analyze scale
> factor * number of tuples, I assumed that this would cause the table to
> be analyzed everytime 5000 tuples were inserted/updated/deleted.

That is right, and exactly how the scaling factor / base value are 
supposed to work, so this should be fine.

> However, the tables have been updated with tens of thousands of inserts
> and the table has still not been analyzed (according to
> pg_stat_user_tables).  Does a scale factor of 0 cause the table to never
> be analyzed?  What am I doing wrong?  I'm using PG 8.2.1.

No a scaling factor of 0 shouldn't stop the table from being analyzed.

Unless it's just a bug, my only guess is that autovacuum may be getting 
busy at times (vacuuming large tables for example) and hasn't had a 
chance to even look at that table for a while, and by the time it gets 
to it, there have been tens of thousands of inserts.  Does that sounds 
plausible?

Also, are other auto-vacuums and auto-analyzes showing up in the 
pg_stats table?  Maybe it's a stats system issue.

In response to

Responses

pgsql-performance by date

Next:From: Jeremy HaileDate: 2007-01-18 20:21:47
Subject: Re: Autoanalyze settings with zero scale factor
Previous:From: Jeremy HaileDate: 2007-01-18 18:37:54
Subject: Autoanalyze settings with zero scale factor

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