truncate
- DDL does not delete table structure, only table data;
- Delete all rows at once, do not count in the log, cannot be rolled back,
- When deleting data, it is equivalent to delete from table. (see the difference below)
- When truncate deletes a table, the space occupied by indexes and foreign keys will return to the minimum initialized; triggers cannot be triggered
delete
- DML does not delete the table structure, only deletes the data;
- Delete line by line, each deleted line is counted in the log and can be rolled back;
- Indexes and foreign keys are maintained
drop
- DDL deletes the entire table structure, the fastest
- 速度:drop>truncate>delete
- delete from table and truncate: For tables referenced by foreign key constraints, you cannot use truncate, use delete
- Only delete can be rolled back
http://www.cnblogs.com/zhizhao/p/7825469.html