Search
 
SCRIPT & CODE EXAMPLE
 

SQL

postgresql find biggest table

select schemaname as table_schema,
    relname as table_name,
    pg_size_pretty(pg_total_relation_size(relid)) as total_size,
    pg_size_pretty(pg_relation_size(relid)) as data_size,
    pg_size_pretty(pg_total_relation_size(relid) - pg_relation_size(relid))
      as external_size
from pg_catalog.pg_statio_user_tables
order by pg_total_relation_size(relid) desc,
         pg_relation_size(relid) desc
limit 10;
Comment

PREVIOUS NEXT
Code Example
Sql :: dbms_scheduler drop_job 
Sql :: postgres get columns names 
Sql :: postgresql update sequence next value 
Sql :: convert utc to est sql 
Sql :: mysql add user with all privileges 
Sql :: redshift running queries 
Sql :: forgot mysql root password stackoverflow 
Sql :: turn on foreign keys check mysql 
Sql :: psql uri example 
Sql :: mysql alter table add index 
Sql :: oracle columns in all_tables 
Sql :: stpop start psql server 
Sql :: Cannot load driver class: com.mysql.cj.jdbc.Driver 
Sql :: find largest table in mysql database 
Sql :: cast string to datetime mysql 
Sql :: string to date postgres 
Sql :: mysql add column if not exists 
Sql :: possgress drop if exists table 
Sql :: mysql interval 1 day 
Sql :: rename column postgres 
Sql :: mysql last 6 months 
Sql :: mysql import gz 
Sql :: stop mysql ubuntu 
Sql :: convert int to string in sql server 
Sql :: sql convert datetime to year month 
Sql :: how to check data type in sql server 
Sql :: String concatenation in PostgreSQL 
Sql :: oracle sql query to make column data uppercase 
Sql :: postgresql pg_dump 
Sql :: sql set auto increment back to 0 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =