0

We've been experimenting with tweaking the autovacuum thresholds on some of our larger tables, because otherwise they never run, but also build up 10s of thousands of dead tuples. Using a query I found somewhere on SO, looking at the pg_stat_user_tables table, I'm able to see the last run time and the number of runs for the autovacuum, but I can't seem to find a history of the events. We're trying to keep track of how often they are running to get some idea of where a good threshold is, so that sort of info would be useful. Is there another table available for this?

shortstuffsushi
  • 2,271
  • 19
  • 33

1 Answers1

2

There is no table with the history (unless you have created one of course or deployed some monitoring system that did it for you, but I don't know of such a one). You can set log_autovacuum_min_duration to zero, then you will have a record going forward in your log files.

jjanes
  • 37,812
  • 5
  • 27
  • 34
  • Since our database is in AWS' RDS, the database logs will go to cloudwatch. I suppose we could then set up some additional rule to filter out the vacuum events? – shortstuffsushi Oct 11 '21 at 18:08
  • I've not used cloudwatch, but I would think that will work. – jjanes Oct 11 '21 at 19:53
  • I'll mark this as correct for now - I was hoping that someone may have stumbled across something else. DataDog (a paid add on) seems to potentially offer such tracking, fwiw. – shortstuffsushi Oct 11 '21 at 21:58