Last active
May 17, 2019 05:18
-
-
Save bastengao/092b0e2e1562fa6e9f68fe07c5af7c7e to your computer and use it in GitHub Desktop.
Execute vacuum analyze for all tables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActiveRecord::Base.connection.tables.each { |name| puts "VACUUM ANALYZE #{name}"; ActiveRecord::Base.connection.execute("VACUUM ANALYZE #{name};") } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment