Last active
April 19, 2016 16:27
-
-
Save agiannis/89fd946e7b5dc732b46f to your computer and use it in GitHub Desktop.
This file contains 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
set @a=null,@c=null,@b=concat("show tables where",ifnull(concat(" `Tables_in_",database(),"` like '",@c,"' and"),'')," (@a:=concat_ws(',',@a,`Tables_in_",database(),"`))"); | |
Prepare `bd` from @b; | |
EXECUTE `bd`; | |
DEALLOCATE PREPARE `bd`; | |
set @a:=concat('optimize table ',@a); | |
PREPARE `sql` FROM @a; | |
EXECUTE `sql`; | |
DEALLOCATE PREPARE `sql`; | |
set @a=null,@b=null,@c=null; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment