Skip to content

Instantly share code, notes, and snippets.

@kamarcum
Created March 11, 2014 14:18
Show Gist options
  • Save kamarcum/9486644 to your computer and use it in GitHub Desktop.
Save kamarcum/9486644 to your computer and use it in GitHub Desktop.
Find your tallest postgres tables
ActiveRecord::Base.connection.execute("SELECT relname, reltuples FROM pg_class where relname NOT LIKE 'pg_%' ORDER BY reltuples DESC LIMIT 10;").each { |row| puts row }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment