Skip to content

Instantly share code, notes, and snippets.

@ricardoaugusto
Created November 3, 2021 09:16
Show Gist options
  • Save ricardoaugusto/13b497fe6774e97259a555a218f3ce3e to your computer and use it in GitHub Desktop.
Save ricardoaugusto/13b497fe6774e97259a555a218f3ce3e to your computer and use it in GitHub Desktop.
Estimate row count for all tables in a SQL DB. Source: https://stackoverflow.com/a/11778602
SELECT TABLE_NAME,SUM(TABLE_ROWS)
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = 'database_name'
GROUP BY TABLE_NAME;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment