Created
September 22, 2016 17:00
-
-
Save zabaala/8b32987b23d73e89ce451f81a55a4a39 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP IF EXISTS TABLE [tmp_table_name]; | |
CREATE TABLE [tmp_table_name] engine=innodb (select * from [reference_table] where ...); | |
SELECT | |
TABLE_NAME AS `Table`, | |
ROUND(((data_length + index_length) / 1024 / 1024), 2) `Size in MB` | |
FROM | |
INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '[schema]' AND TABLE_NAME = '[tmp_table_name]'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment