What does `TRUNCATE` do differently from `DELETE` regarding transaction logs and performance?

Advanced SQL Developer Medium

Advanced SQL Developer — Medium

What does `TRUNCATE` do differently from `DELETE` regarding transaction logs and performance?

Key points

  • TRUNCATE is a DDL operation, DELETE is a DML operation
  • TRUNCATE deallocates data pages with minimal logging
  • DELETE logs each row individually
  • TRUNCATE cannot be filtered with WHERE, DELETE can
  • TRUNCATE is faster on large tables

Ready to go further?

Related questions