Sunday, 1 March 2015

why truncate is faster than delete in sql

When we type DELETE.all the data get copied into the Rollback Tablespace first.then delete operation get performed.Thats why when you type ROLLBACK after deleting a table ,you can get back the data(The system get it for you from the Rollback Tablespace).All this process take time.But when you type TRUNCATE,it removes data directly without copying it into the Rollback Tablespace.Thatswhy TRUNCATE is faster.Once you Truncate you cann't get back the data.