truncate is faster than delete bcoz truncate is a ddl command so it does not produce any rollback information and the storage space is released while the delete command is a dml command and it produces rollback information too and space is not deallocated using delete command.
Truncate is more faster than delete. Since it has a power of releasing the structure of table storage size and deallocates whereas delete is used to mere deletion of records in tables with the usage of where clause as a optional one. Truncate is also fall under DDL part.
A TRUNCATE statement can be rolled back if it is performed within a transaction. The speed of the TRUNCATE statement itself testifies that the actual data is not erased untill it's rewritten. So it is possible to rollback A TRUNCATE Statement.
TRUNCATE is faster than DELETE because truncate does not logs the rows that are deleted where as DELETE keeps a record of rows deleted till the transaction is committed.This is the reason why data that is truncated is non recoverable.
Truncate is faster than delete because it just resets the high water mark. Delete performs operations on each record (delete rollback segmen..). The downside is that once a table is truncated all the space it used before is immediately released. Once the truncate is executed the space taken up by the table before is free and can be used by any other session. Hence no commit is needed no rollback is possible and you can only delete all data not a subset. Essentially truncate drops the whole data part of the table. Whereas delete removes elements from the data one by one.
1. Truncate is an autocommit transaction; therefore as soon as this is executed the database is commited. 2. Delete is a forced-commit transaction which gives luxury of rollback.
Therefore once we want to delete all the records of any table we use truncate instread of delete which will be much faster.