Last Updated: February 25, 2016
·
1.128K
· rafaelpsouza

Enable Heroku Postgresql autovacuum

heroku pg:psql --app app_name
ALTER TABLE table_name SET (autovacuum_vacuum_threshold = 50);
ALTER TABLE table_name SET (autovacuum_vacuum_scale_factor = 0.2);
ALTER TABLE table_name SET (autovacuum_enabled = true, toast.autovacuum_enabled = true);

For more information:

https://devcenter.heroku.com/articles/heroku-postgres-database-tuning
http://www.postgresql.org/docs/9.2/static/routine-vacuuming.html#AUTOVACUUM