Skip to main content

Vacuum

select * from pg_stat_progress_vacuum;
  • phase
    • initializing
    • scanning heap - heap_blks_scanned
    • vacuuming indexes
    • vacuuming heap - heap_blks_vacuumed
    • cleaning up indexes
    • truncating heap
    • performing final cleanup

When to vacuum

  • 进行了大量的表修改
  • 感觉查询有性能问题