What is the difference between delete and truncate statement in MariaDB?

devquora
devquora

Posted On: Feb 22, 2018

 

  • TRUNCATE TABLE is used only when the whole table has to be deleted or removed permanently while the DELETE TABLE is considerably used when it has to remove only columns which can be one or more in number or has to remove the whole table.
  • Both of these TABLES (TRUNCATE and DELETE) are exactly the same. The basic difference between these two is WHERE clause.
  • Truncate table is quite faster than the delete table.
  • DELETE TABLE is used to delete row only one at a particular time and this is recorded in the transaction log.
  • TRUNCATE TABLE also kept the record in the transaction log but it firstly eliminates the data by deallocating it which is efficient to store and record. That is the main reason that TRUNCATE is faster than the DELETE TABLE.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    MariaDB Interview Questions

    What do you understand by the MariaDB?

    MariaDB is developed by MySQL developers. It is a popular public source under GNU GPL which is related to database management technology...

    MariaDB Interview Questions

    Mention some characteristics of MariaDB?

    It has a lot of unique features that make it more useful and wonderful to work over it than MySQL. Some features are:..

    MariaDB Interview Questions

    Which command is used to delete the table in MariaDB’s database?

    The command DROP TABLE is used to delete the table in MariaDB’s database...