mysql get table size

Solutions on MaxInterview for mysql get table size by the best coders in the world

showing results for - "mysql get table size"
Oscar
22 Jan 2016
1SELECT
2  TABLE_NAME AS `Table`,
3  ROUND((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024) AS `Size (MB)`
4FROM
5  information_schema.TABLES
6WHERE
7  TABLE_SCHEMA = "bookstore"
8ORDER BY
9  (DATA_LENGTH + INDEX_LENGTH)
10DESC;
11
Mirko
16 Oct 2019
1SELECT 
2     table_schema as `Database`, 
3     table_name AS `Table`, 
4     round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB` 
5FROM information_schema.TABLES 
6ORDER BY (data_length + index_length) DESC;
7
Luciana
15 Jun 2017
1SELECT pg_size_pretty( pg_total_relation_size('tablename') );
2(postgres)
similar questions
queries leading to this page
mysql get table size