MySQL Several cases of deleting tables :

1,drop table table_name : Delete all table data and table structure , Free up disk space now , No matter what Innodb and MyISAM;

2,truncate table table_name : Delete all table data , Preserve table structure , Free up disk space now , No matter what Innodb and MyISAM; 

        This command allows the table index to change from 1 start .

3,delete from table_name : Delete all table data , Table structure unchanged , about MyISAM Will free up disk space immediately ,InnoDB Disk space will not be released ;

4,delete from table_name where xxx : Conditional deletion , Table structure unchanged , No matter what Innodb and MyISAM;
Will not free up disk space ;

5,delete After operation , use optimize table table_name Will free up disk space immediately , No matter what Innodb and MyISAM;

6,delete from The table does not free disk space later , But the next time you insert data , You can still use this space .

In short :

1, When you no longer need the watch , use drop;

2, When you still want to keep the watch , But to delete all records , use truncate;

3, When you want to delete some records , use delete.
 

Technology
©2019-2020 Toolsou All rights reserved,
Forbes China Auto rich list : He xiaopengdi 11 Li Xiangdi 14 Li Bindi 15 Change one's mind ! Tesla starts to deliver made in China to European market Model 3 The difference between memory overflow and memory leak , Causes and Solutions Character recognition technology of vehicle license plate based on Neural Network Vue Transfer parameters and receiving of page Jump SparkSQL Achieve partition overlay write 1190 Reverses the substring between each pair of parentheses leetcode Note 14 : The second biggest obstacle to motivating others in R & D management Chrome OS, For programmers and Windows What does it mean ? Internet Marketing JAVA Convert a string to a numeric type