Created
June 17, 2013 14:07
-
-
Save mintsoft/5797136 to your computer and use it in GitHub Desktop.
Iterate over tables in public schema and run analyze
This file contains 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
#!/bin/bash | |
db="postgres" | |
psql -qAt -c "SELECT tablename FROM pg_tables WHERE schemaname='public';" $db | while read line; do | |
psql -qAt -c "ANALYZE $line;" $db; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment