DBA Hub

📋Steps in this guide1/1

Manage autovacuum process in postgres

Autovacuum methods automates the executions vacuum,freeze and analyze commands.

postgresql configurationintermediate
by PostgreSQL
14 views
1

Manage autovacuum process in postgres

-- Find whether autovacuum is enabled or not: -- Find other autovacuum related parameter settings dbaclass=# select name,setting,short_desc,min_val,max_val,enumvals,boot_val,pending_restart from pg_settings where category like 'Autovacuum'; - Change autovacuum settings:( they need restart)

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Autovacuum methods automates the executions vacuum,freeze and analyze commands.
dbaclass=#
select name,setting,short_desc,boot_val,pending_restart from pg_settings where name in ('autovacuum','track_counts');
name.         | setting | short_desc                                | boot_val | pending_restart
--------------+---------+-------------------------------------------+----------+-----------------
autovacuum    | on      | Starts the autovacuum subprocess.         | on        | f
track_counts  | on      | Collects statistics on database activity. | on        | f
(2 rows)
dbaclass=#
alter system set autovacuum_max_workers=10 ;
ALTER SYSTEM
Now restart :
pg_ctl stop
pg_ctl start

Comments (0)

Please to add comments

No comments yet. Be the first to comment!