Sponsored Links

Ad by Google
Sometimes we need to find out the database sizes in our machine. As Yesterday my team lead from onsite, asking me to find out the database size for 80 million records. Fortunately, we had exactly the same number of records in our testing environment. Here I am sharing the same script which were helped me to get the size of the database.

To find out the exact size of the database, we have to find out the data length and index length

MySQL Query:

SELECT table_schema "Data Base", SUM( data_length + index_length) / 1024 / 1024 
"Size in MB" FROM information_schema.TABLES GROUP BY table_schema ;


That's it :)
Sponsored Links


Post a Comment