![]() ![]() Note: I used the round function for make it more readable form, for exact size remove round of function from SQL queries. SELECT table_schema "DB Name", table_name,(data_length + index_length)/1024/1024/1024,1 "TableSizeGB" from information_schema.tables where table_schema='mysql' and table_name = 'test' That should expand it and show much more info about it. Click on the instance in which you are interested. This example returns a list of databases on the instance of SQL Server. I finally found the easy way to get this information directly from Amazon with a couple of clicks. SELECT TABLESCHEMA AS databasename, ROUND(SUM(DATALENGTH + INDEXLENGTH) / 1024 / 1024, 2) AS Size in MB FROM informationschema. We can do this with the following syntax. Copy and paste the following example into the query window and select Execute. Use the SELECT Statement to Get the Size of a MySQL Database We can use the SELECT statement to get the size of a database. ![]() SELECT table_schema "DB Name", table_name,round((data_length + index_length)/1024/1024,1) "TableSizeMB" from information_schema.tables where table_schema='mysql' and table_name = 'test' To view a list of databases on an instance of SQL Server Connect to the Database Engine. ![]() SELECT table_schema "DB Name", table_name,(data_length + index_length)/1024/1024,1 "TableSizeMB" from information_schema.tables where table_schema='mysql' and table_name = 'test' SELECT table_schema AS "Database", SUM(data_length + index_length ) /1024/1024/1024 AS "Size (GB)" FROM information_schema.TABLES GROUP BY table_schema Here is what the MySQL Documentation says on this: The larger you set this value, the less disk I/O is needed to access data in tables. SELECT table_schema AS "Database", SUM(data_length + index_length)/1024/1024 AS "Size (MB)" FROM information_schema.TABLES GROUP BY table_schema This is very important to note: At times, InnoDB may require an additional 10 over the value for the innodbbufferpoolsize. Check size of database and table in MySQL ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |