-1

Auto Vacuum executes Vacuum and Analyze when the threshold is exceeded. The threshold values are as follows:

  • autovacuum_vacuum_threshold + autovacuum_vacuum_scale_factor * rows
  • autovacuum_analyze_threshold + autovacuum_analyze_scale_factor * rows

In PostgreSQL, is there a way to stop Analyze while keeping Auto Vacuum's Vacuum running automatically?

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263
chihiro
  • 31
  • 1
  • 5

1 Answers1

0

The best you can do is set autovacuum_analyze_scale_factor to its maximum 100 for that table, then it will only be analyzed once 100 times as many rows have been modified as are in the table.

But it is not a smart idea to disable autoanalyze, and you shouldn't do it.

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263
  • Thanks. As you said, Of course, I don't want to turn it off. I wanted to make sure that batch processing and Analyze do not overlap. – chihiro Dec 21 '20 at 13:25
  • 1
    Then you can temporarily (!) set `autovacuum_enabled = off` on that table and run `VACUUM` manually as part of the batch job whenever needed. – Laurenz Albe Dec 21 '20 at 13:38