Unexpected growth of Log(.ldf file)(Deleting 500MB table is creating 10GB of log)

I am trying to detele a table of size 500Mb and it is creating a log file of 10GB. If I try to delete 3-4 tables of that size simultaneously then it is overflowing my tempdb drive. I know deleting in small chunks is a better way to do it but i cannot implement it in my scenario.

Is there any proper explaination of why deleting 500MB table is creating 10GB of log?

dbaner2Asked:
Who is Participating?
 
Randy DownsOWNERCommented:
The log is probably documenting each delete row at a time. Still 10 G seems excessive
0
 
Randy DownsOWNERCommented:
Maybe this will help - http://stackoverflow.com/questions/571750/make-sql-server-faster-at-manipulating-data-turn-off-transaction-logging

"configure the database (each database on a server can be different) for simple backups the log file won't grow until you back it up. This is done by setting the recovery mode to "simple".

With simple backups the log is only used to hold the state of transactions until they are fully written into the main database.
"
0
 
Kevin CrossChief Technology OfficerCommented:
Are you deleting everything in the tables?  Use TRUNCATE instead or you can try to break up the deletes.
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
Daniel_PLDB Expert/ArchitectCommented:
Are you completely deleting data from tables?
If yes (and table(s) don't have foreign key(s)) you can truncate table(s). When you need part of data from table(s) (basically smaller than deleted part) you can first insert data you want to persist, truncate table and get your data back.
0
 
dbaner2Author Commented:
I understand that part. But I am more interested to know:

Why deleting 500MB table is creating 10GB of log? What is SQL Server writing into the log file so much more than the data itself?

0
 
Daniel_PLDB Expert/ArchitectCommented:
This is by design, delete is performed on row basis so each row needs to be fully logged with maintaining each log sequence number.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.