What is the difference between the DELETE TABLE and TRUNCATE TABLE commands in MySQL?

Answer Posted / hrindows@gmail.com

DELETE TABLE is a logged operation, and every row deleted is logged. Therefore, the process is usually slow.
TRUNCATE TABLE also deletes rows in a table, but it will not log any of the rows deleted. The process is faster here in comparison. TRUNCATE TABLE can be rolled back and is functionally similar to the DELETE statement without a WHERE clause.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I tune a mysql query?

482


What is difference between group by and order by clause?

554


Is there a free mysql?

502


What is the purpose of mysql database?

489


What is the purpose of using timestamp data type?

508






How do I insert multiple rows in a table?

466


What are stored procedures and functions?

480


How do you determine the location of mysql data directory?

499


What is join in mysql? What are the different types of join?

514


What is difference between inner vs self vs cross?

515


What is the difference between primary key and candidate key?

516


What is procedures in mysql?

518


Is there a way to see the files which are stored?

503


How do I backup mysql database on linux?

495


What causes mysql too many connections?

490