Skip to content

Instantly share code, notes, and snippets.

@felipsmartins
Last active February 8, 2020 23:24
Show Gist options
  • Save felipsmartins/26dd4e6b1793b0f6e39ac9c869af8a7e to your computer and use it in GitHub Desktop.
Save felipsmartins/26dd4e6b1793b0f6e39ac9c869af8a7e to your computer and use it in GitHub Desktop.
total_row_count_from_database
SELECT SUM(TABLE_ROWS) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'MY_DATABASE_NAME';
SELECT table_name, table_rows FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'MY_DATABASE_NAME' order by table_rows;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment