DBA Hub

📋Steps in this guide1/1

Reorg a table using VACUUM command

VACUUM - >  REMOVES DEAD ROWS, AND MARK THEM FOR REUSE, BUT IT DOESN’T RETURN THE SPACE TO ORACLE,. IT DOESN'T NEED EXCLUSIVE LOCK ON THE TABLE.

postgresql configurationintermediate
by PostgreSQL
11 views
1

Reorg a table using VACUUM command

vacuum a table: both vacuum and analyze: with verbose: Monitor vacuum process( if vacuum process runs for a long time) Check vacuum related information for the table

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
VACUUM - >  REMOVES DEAD ROWS, AND MARK THEM FOR REUSE, BUT IT DOESN’T RETURN THE SPACE TO ORACLE,. IT DOESN'T NEED EXCLUSIVE LOCK ON THE TABLE.
-------------------------------------------------------------------------
dbaclass=#
vacuum dbatest.emptab;
VACUUM
dbaclass=# v
acuum analyze dbatest.emptab;
VACUUM
dbaclass#
vacuum verbose analyze dbatest.emptab;
dbaclass#
select * from pg_stat_progress_vacuum;
dbaclass=#
select schemaname,relname,last_vacuum,vacuum_count from pg_stat_user_tables where relname='emptab';
schemaname  | relname | last_vacuum                      | vacuum_count
------------+---------+----------------------------------+--------------
dbatest     | emptab  | 2020-07-21 18:35:34.801402+05:30 | 2
(1 row)

Comments (0)

Please to add comments

No comments yet. Be the first to comment!