Search
 
SCRIPT & CODE EXAMPLE
 

SQL

list of schema with sizes (relative and absolute) in a PostgreSQL database

SELECT schema_name, 
       pg_size_pretty(sum(table_size)::bigint),
       (sum(table_size) / pg_database_size(current_database())) * 100
FROM (
  SELECT pg_catalog.pg_namespace.nspname as schema_name,
         pg_relation_size(pg_catalog.pg_class.oid) as table_size
  FROM   pg_catalog.pg_class
     JOIN pg_catalog.pg_namespace ON relnamespace = pg_catalog.pg_namespace.oid
) t
GROUP BY schema_name
ORDER BY schema_name
Comment

PREVIOUS NEXT
Code Example
Sql :: restart sequence table mysql 
Sql :: get all employees if name ends with in sql 
Sql :: select save as table postgres 
Sql :: sql query use select name inside where clause 
Sql :: sp help text in postgresql 
Sql :: apikey in pl sql 
Sql :: redudancy in SQL 
Sql :: Laravel SQLSTATE[HY093] with array query 
Sql :: truncate syntax in sql 
Sql :: sql server agent not running 
Sql :: VYSTUPNI PARAMETR ULOZENE PROCEDURY SQL 
Sql :: IN from in sql 
Sql :: psql create usr 
Sql :: group by join columns per table 
Sql :: findAllBy 
Sql :: insert column rake 
Sql :: use between operator in mysql 
Sql :: sqlite closes value 
Sql :: store case result sql 
Sql :: flexible search query delete table 
Sql :: SQL Aliases with MAX() and MIN() 
Sql :: get employees if not contains in sql 
Sql :: create dabase psql 
Sql :: select distinct records in sql with maximum time desc 
Sql :: mysql create user if not exists 
Sql :: sql alchemy escape ; in insert statement 
Sql :: compare two tables to find unmatched records 
Sql :: sqlalchemy sequence postgresql 
Sql :: SQL server datetime compare 
Sql :: mysql 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =