Re: Autovacuum not running properly

From: Rajesh Kumar <rajeshkumar(dot)dba09(at)gmail(dot)com>
To: "Wetmore, Matthew (CTR)" <Matthew(dot)Wetmore(at)express-scripts(dot)com>
Cc: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Autovacuum not running properly
Date: 2023-08-28 16:34:17
Message-ID: CAJk5AtYE5X0+DCMTeDBTXGLm_FF0A_vwUFscgBsjyE+KoieWCg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Thanks a lot. I will check

On Mon, 28 Aug 2023, 19:13 Wetmore, Matthew (CTR), <
Matthew(dot)Wetmore(at)express-scripts(dot)com> wrote:

> -- Find current setting (this is at database level)
>
> select * from pg_settings where name in
> ('autovacuum','autovacuum_analyze_scale_factor','autovacuum_analyze_threshold','autovacuum_vacuum_scale_factor');
>
> select current_setting('autovacuum_vacuum_scale_factor') as
> "analyze_scale_factor",current_setting('autovacuum_vacuum_threshold') as
> "vacuum_threshold";
>
> select current_setting('autovacuum_analyze_scale_factor') as
> "analyze_scale_factor", current_setting('autovacuum_analyze_threshold') as
> "analyze_threshold";
>
> -- Note: The smaller number = more aggressive = vacuum more frequence
>
> -- Current:
>
> -- autovacuum_analyze_scale_factor = 0.05
>
> -- autovacuum_vacuum_scale_factor = 0.1
>
> -- Fine Tune at table level = ALTER TABLE mytable SET
> (autovacuum_analyze_scale_factor = 0.02);
>
> ALTER TABLE your_schema.your_table SET (autovacuum_enabled =
> true,autovacuum_analyze_scale_factor = 0.002,autovacuum_vacuum_scale_factor
> = 0.001);
>
> -- Put it back to use global setting
>
> ALTER TABLE your_schema.your_table RESET
> (autovacuum_enabled,autovacuum_analyze_scale_factor,autovacuum_vacuum_scale_factor);
>
>
>
> *From:* Rajesh Kumar <rajeshkumar(dot)dba09(at)gmail(dot)com>
> *Sent:* Sunday, August 27, 2023 4:09 AM
> *To:* pgsql-admin(at)lists(dot)postgresql(dot)org
> *Subject:* [EXTERNAL] Autovacuum not running properly
>
>
>
> Hi
>
>
>
> Why Autovacuum is not running on specific tables while it works on other
> tables and how to resolve this.
>
>
>
> And for some tables the last autovacuum done is 2days ago whereas most are
> till today.
>
>
>
>
>
> How to analyze autovacuum and take action?
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Nikhil Shetty 2023-08-30 14:14:05 Logical Replication hung: logical_decoding_work_mem over utilised
Previous Message Wetmore, Matthew (CTR) 2023-08-28 13:43:55 Autovacuum not running properly