Re: Why autvacuum is not started?

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Edmundo Robles <edmundo(at)sw-argos(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Why autvacuum is not started?
Date: 2017-01-09 17:24:25
Message-ID: 20528929-d604-2db2-dba6-0102717532ef@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 01/09/2017 08:45 AM, Edmundo Robles wrote:
> I have running Postgresql 9.4 and... if i have a table with
> following configuration:
> autovacuum_vacuum_scale_factor=0.0,
> autovacuum_analyze_scale_factor=0.0,
> autovacuum_vacuum_threshold=1000,
> autovacuum_analyze_threshold=1000,
> autovacuum_enabled=true
>
> Why autovacuum is not started if the table has more than 1000 inserts???

https://www.postgresql.org/docs/9.4/static/runtime-config-autovacuum.html#GUC-AUTOVACUUM-VACUUM-THRESHOLD

"autovacuum_vacuum_threshold (integer)

Specifies the minimum number of updated or deleted tuples needed to
trigger a VACUUM in any one table. The default is 50 tuples. This
parameter can only be set in the postgresql.conf file or on the server
command line. This setting can be overridden for individual tables by
changing storage parameters.
"

INSERTs don't count.

They do for analyze though:

"autovacuum_analyze_threshold (integer)

Specifies the minimum number of inserted, updated or deleted tuples
needed to trigger an ANALYZE in any one table. The default is 50 tuples.
This parameter can only be set in the postgresql.conf file or on the
server command line. This setting can be overridden for individual
tables by changing storage parameters.
"
>
> first i have setted autovacuum_vacuum_threshold to 10,000 inserts
> (it is normal each 2 hours ), then to 5,000, 3,000 and finally to
> 1,000 but autovacuum is not triggered but autoanalyze.
>
> "select relname,last_vacuum, last_autovacuum, last_analyze,
> last_autoanalyze from pg_stat_user_tables where relname like 'sta%';"
>
> last_vacuum=>2017-01-05 10:40:34.228633-06
> last_autovacuum => null
> last_analyze=> 2017-01-04 15:02:47.438715-06
> last_autoanalyze=> 2017-01-09 10:35:51.391114-06
>
> --
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Israel Brewster 2017-01-09 17:49:12 Re: Improve PostGIS performance with 62 million rows?
Previous Message Edmundo Robles 2017-01-09 16:45:57 Why autvacuum is not started?