Skip to content

Instantly share code, notes, and snippets.

@ecarreras
Created August 1, 2012 12:45
Show Gist options
  • Save ecarreras/3226535 to your computer and use it in GitHub Desktop.
Save ecarreras/3226535 to your computer and use it in GitHub Desktop.
Tamany de taules de la base de dades
SELECT
schemaname, tablename, pg_size_pretty(size) AS size_pretty,
pg_size_pretty(total_size) AS total_size_pretty
FROM
(SELECT *, pg_relation_size(schemaname||'.'||tablename) AS size,
pg_total_relation_size(schemaname||'.'||tablename) AS total_size
FROM pg_tables where schemaname = 'public') AS TABLES
ORDER BY total_size DESC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment