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,
Final review of database : Summary of comprehensive application questions Laplance operator ( Second derivative ) Simple learning of computer composition principle pyqt Button call python program _PyQt: Link button to function in program How much can you go up once you change jobs ? Today, I saw the ceiling of job hopping python in str Function usage _python in str Usage Summary of built-in functions MySQL trigger web The server nginx---linux Installation and deployment C++ Chapter V polymorphism exercises :( It's coming to an end )python Check built-in functions , How to check python Built in function