I tested the autovacuum
in PostgreSQL. So I create a table company
and insert 100 records
. Then I checked the table size like,
ganapathy=> \dt+ company
List of relations
Schema | Name | Type | Owner | Size | Description
--------+---------+-------+-----------+-------+-------------
public | company | table | ganapathy | 54 kB |
After that I update all the records in a table like,
ganapathy=> update company set address = 'California' where id between 1 and 100;
Then I checked the table size, It gives the size like this,
ganapathy=> \dt+ company
List of relations
Schema | Name | Type | Owner | Size | Description
--------+---------+-------+-----------+-------+-------------
public | company | table | ganapathy | 72 kB |
So checked the configuration file of postgresql.conf, In that the autovacuum is already enabled,
autovacuum = on
But the autovacuum has not worked. So after two days I checked the table size again,
But even though the table size has not changed.
ganapathy=> \dt+ company
List of relations
Schema | Name | Type | Owner | Size | Description
--------+---------+-------+-----------+-------+-------------
public | company | table | ganapathy | 72 kB |
So I want to know,
- Why its not working for me?
- When the autovacuum process will work in PostgreSQL?
Please help me.
Thanks in Advance…!
Best Answer
PostgreSQL documentation
AUTOVACUUM
is the standard form ofVACUUM
run automatically. If you insist on freeing unused space from tables, then do manualVACUUM FULL
.