I have 2 Remoteremote SQL Server 2014 Serversinstances: Server A with Versionversion 12.0.4100.1 and Server B with Versionversion 12.0.4213.0.
I have exported a DB from server B, copied and restored it to server A for tests. I have a Querryquery (really long) which I execute on both Serversservers. The Server B returns the results in 2 min and server A in 1-2 sec. I have tried to export back the DB from Server A to server B, the same DB and nothing changes.
I have noticed the folowingsfollowing on server B: if I export all the Tablestables of the DB into a TempDB, then delete all the Tablestables from DB and then import all the Tablestables from TempDB back into DB the Problemproblem is gone. This happens for both the old (original) DB and the new (exported back from server A) one as well.
My Problemproblem: what can cause this "Problem""problem" and how to prevent it?