| Bug #39646 | To check space occupied by tables | ||
|---|---|---|---|
| Submitted: | 25 Sep 2008 9:08 | Modified: | 25 Sep 2008 9:18 |
| Reporter: | Shueb Khan | Email Updates: | |
| Status: | Not a Bug | Impact on me: | |
| Category: | MySQL Server: Information schema | Severity: | S3 (Non-critical) |
| Version: | 5.1.26 | OS: | Linux |
| Assigned to: | CPU Architecture: | Any | |
| Tags: | To check space occupied by tables | ||
[25 Sep 2008 9:18]
Sveta Smirnova
We're sorry, but the bug system is not the appropriate forum for asking help on using MySQL products. Your problem is not the result of a bug. Support on using our products is available both free in our forums at http://forums.mysql.com/ and for a reasonable fee direct from our skilled support engineers at http://www.mysql.com/support/ Thank you for your interest in MySQL.

Description: We would be using the below mentioned query for checking space used by tables. Could you please tell us if the query is right for this purpose, and if it gives the results for qll " table types together (Fixed, Dynamic ou Compressed) Thanks SELECT TABLE_NAME as 'Name table', TABLE_ROWS as 'NB lines',ROW_FORMAT as 'Format Table' . , Max_data_length as 'Max_Data_Length', Data_length as 'Data_Length' . ,Avg_row_length as 'Avg_row_length',Index_length as 'Index_length ' . ,Data_free as 'Data_free ', ( DATA_LENGTH + INDEX_LENGTH) as 'Size (MB)' . ,ROUND( SUM( (DATA_LENGTH + INDEX_LENGTH) / (1024 * 1024) ) . / ( SELECT SUM( (DATA_LENGTH + INDEX_LENGTH) / (1024 * 1024) ) . FROM information_schema.TABLES WHERE table_schema = '<table_name>' ) * 100, 2 ) . AS Pourcent,Update_time as 'Update_time' FROM information_schema.tables . WHERE table_schema = '<schema_name>' AND table_name = '<table_name>' GROUP BY TABLE_NAME; How to repeat: NA