I am facing a slowness issue while restoring a database backup worth 6 GB on a SQL 2005 instance. It is taking around 1 hr and 50 minutes for the backup to get restored properly.
Initial investigation done by me found that it would be due to RAID 5 due to which we moved our Data and Log file to RAID 10 drives after which the speed improved but by 30%. On Further investigation by doing through the Transactional Log file, I noticed that the VLF count was pretty high i.e. around 1000 which looked pretty high to me. Although this database was a part of log shipping but still the size of the transactional log file of the database was pretty high. On further analysis, I noticed that as soon as the LSBackup job of LogShipping executed and then if I execute the DBCC ShrinkFile command as the next step of the LSBackup job the size of the ldf file of the database came down drastically. Also the VLF count came down to a mere 6 instead of 1000 and then if I take the Full Backup of the database and try to restore it on the same drive whose RAID level is RAID 10 it gets restored within 59 seconds which looks pretty OK.
The important question and the challenge here is that I have read many times across n number of articles published till date written by renowned authors that shrinking the log file is bad, it can impact the fragmentation level of the indexes in the database thereby impacting performance, and therefore I decided to ask this question to the SQL community on SSC.
I look forward hearing a positive feedback from you all on this case.