SQL Server Slow execution after migration to new server

So my last post got me thinking what was also big problem that I spent days trying to resolve. And then I remembered.

We were doing migration of database and application from old server to new one. Everything went smoothly, everything was up and running untill couple of days later. One of procedures was taking forever to finish, at least that’s what client has reported.

And they were right, stored procedure took 18 minutes to finish. So we started testing. On old server, procedure was executing in 2-3 minutes. With same data on  new server, it was taking 18-20 minutes.

Just to be clear here are specs for new and old server:

OLD server – 16 GB RAM, disks on 7.2k, RAID 5 (not ideal for database)

NEW server – 64 GB RAM. disks on 10k, RAID 10 (much better for database)

Both servers were running Windows Server 2012 and SQL Server 2012.

And we started testing and comparing everything. Updating statistics, table by table,fullscan, comparing execution plans (those turned up being identical)… We did everything we could think of and it took us days.

So then it hit me, we never checked for IOPS. Input/output operations per second was thing that was slowing us down. Noone paid notice to it as new server was superior in everything to old one exept that one little thing. As procedure was processing millions of rows of data, it processed ‘only’ 5.000 rows in part of second and waited idle for new interval (new second) to start processing new data. Problem was that procedure was writen in a way that processing every row was different process.

After working on procedure and spining things around solution was very simple. Placing one ‘begin’ and one ‘commit’  at beginning and end of procedure was very simple solution (thanks to Enes Hatibovic). This way procedure was considered as one operation and execution was under a minute.

So solution was again very simple but process to find what core of problem was, it took us days to notice.

Hope it helps someone.

Article by Mustafa Toroman

I’m System Engineer at Authority Partners. I love to test and explore new technologies. Have over 20 active MS certificates such as MCSA for Windows Server and SQL Server, MCSE Private Cloud, Data Platform, Business Intelliegence and Server Infrastracture. Lately most interested in BI and Azure solutions. MCT since 2012. From 2016 MVP for Microsoft Azure.

8 Comments


  1. Hello! My name is Valeria Dockery and I live in Deerfield,IL. I have read your blog post about SQL Server Slow execution after migration to new server – Toroman and I want to say that I am quite impressed with your professionalism on the subject!

  2. Outstanding post, you have pointed out some superb points, I besides believe this s a very fantastic website.

  3. I couldn’t find anything on this error except here! Thank you, you saved my day! Is this error common and how come I can’t find this error anywhere else?

  4. Hey! I could have sworn I’ve been to this blog prior to but right after reading as a result of some of the submit I recognized it’s new to me. Nonetheless, I’m surely delighted I found it and I’ll be bookmarking and checking back again often!

Leave a Reply to steve Cancel reply

Your email address will not be published. Required fields are marked *