How can I perform the vacuum using the PostgreSQL?

后端 未结 2 1647
旧巷少年郎
旧巷少年郎 2021-02-08 07:27

I need to vacuum the PostgreSQL database in production server. I am very new to do this. So anybody knows the PostgreSQL steps, please guide me.

I think it\'s very usefu

相关标签:
2条回答
  • 2021-02-08 07:52

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

    If you want to see lots of detail, you can at the console type "vacuum verbose"

    The more extreme form is "vacuum full" which causes heavy table locking and cannot really be used on a production system.

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

    0 讨论(0)
  • 2021-02-08 07:59

    If you're running a recent version of PostgreSQL you likely have auto-vacuum running so the benefits of running VACUUM manually may be very minimal.

    0 讨论(0)
提交回复
热议问题