Warning: Declaration of ss_framework_description_walker::start_el(&$output, $item, $depth, $args) should be compatible with Walker_Nav_Menu::start_el(&$output, $item, $depth = 0, $args = Array, $id = 0) in /homepages/42/d439463719/htdocs/wp-content/themes/smartstart/functions/custom-functions.php on line 82
Differences between TRUNCATE and DELETE in MySQL | APPassionate – Web designs and apps
info@appassionate.es
655 600 161

Differences between TRUNCATE and DELETE in MySQL

DELETE

  • DELETE is a DML Command.
  • DELETE statement is executed using a row lock, each row in the table is locked for deletion.
  • We can specify filters in where clause
  • It deletes specified data if where condition exists.
  • Delete activates a trigger because the operation are logged individually.
  • Slower than truncate because, it keeps logs.
  • Rollback is possible.

TRUNCATE

  • TRUNCATE is a DDL command.
  • TRUNCATE TABLE always locks the table and page but not each row.
  • Cannot use Where Condition.
  • It Removes all the data.
  • TRUNCATE TABLE cannot activate a trigger because the operation does not log individual row deletions.
  • Faster in performance wise, because it doesn’t keep any logs.
  • Rollback is possible.

Introducir Comentario

Puedes usar las siguientes etiquetas y atributos HTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>