How to get table size in MySQL

How to get table size in MySQL: We can get this information from the schema ‘information_schema’.

Query:

SELECT table_name AS 'Table', round(((data_length + index_length) / 1024 / 1024), 2) 'Size in MB' FROM information_schema.TABLES WHERE table_schema = "sakila" AND table_name = "rental";

Output

+--------+------------+ | Table | Size in MB | +--------+------------+ | rental | 2.66 | +--------+------------+

How to get table size in MySQL

CheapSexCams
Responses are currently closed, but you can trackback from your own site.

Comments are closed.

Powered by k2schools
%d bloggers like this: