Skip to content

Instantly share code, notes, and snippets.

View cmlenz's full-sized avatar

Christopher Lenz cmlenz

View GitHub Profile
@cmlenz
cmlenz / gist:1992369
Created March 7, 2012 10:13 — forked from thomasbilk/database_size.sql
Database Sizes
-- PostgreSql
SELECT
pg_database.datname AS "Database Name",
pg_database_size(pg_database.datname) / 1024.0 / 1024.0 AS "Database Size (MB)"
FROM pg_database;
-- MySql
SELECT
table_schema "Database Name",
sum( data_length + index_length ) / 1024 / 1024 "Database Size (MB)"