How can I perform a vacuum using PostgreSQL?

I need to vacuum a PostgreSQL database on a production server. I am very new to this. So, does anyone know the steps of PostgreSQL, please guide me.

I think it is very useful to improve the performance of PostgreSQL on a production server.

+4
source share
2 answers

Connect to the database and run this command: "VACUUM". This leads to a run in "lazy mode", which can be used during normal use. It is recommended that you actually call it as a "vacuum analysis", which will also update statistics.

If you want to see a lot of details, you can in the console type "vacuum detail"

The more extreme the form is "filled with vacuum", which causes a strong blocking of the table and cannot be really used in the production system.

Source: http://www.postgresql.org/docs/8.1/static/maintenance.html

+8
source

If you are using the latest version of PostgreSQL, you probably have an auto-vacuum, so the benefits of running VACUUM manually can be very minimal.

+2
source

Source: https://habr.com/ru/post/1336460/


All Articles