SQL Server Migration from 2012 to 2014 is degrading the query performance

  • We are trying to migrate from sql server 2012 to sql server 2014 on windows 2000 R2 OS.

    After the upgrade, we are doing performance testing and observed huge difference in running a simple query from only one table (No joins at all).

    The query is getting executed in 4 seconds in Sql 2012, but taking more than 1 minute in sql 2014. Both are running on the same OS with same hardware configurations.

    From the execution plan, observed difference in the below property (EstimatedPagesCached).

    In Sql Server 2014, we are getting below one :

    <OptimizerHardwareDependentProperties EstimatedAvailableMemoryGrant="104844" EstimatedPagesCached="1280" EstimatedAvailableDegreeOfParallelism="2" />

    whereas in 2012, we are getting below one :

    <OptimizerHardwareDependentProperties EstimatedAvailableMemoryGrant="104844" EstimatedPagesCached="2128" EstimatedAvailableDegreeOfParallelism="2" />

    Any help is highly appreciated.

    Thanks in advance

    Gopi Srinivas.

  • First question, as we can see a difference in caching:-

    Do the settings for "memory made available to SQL Server" vary between the two instances?

  • --Removed

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • Haven't selected any memory options. Just followed the installation document given in the msdn site.

    Also not sure from where that property is picked up by sql server. I have checked the page cache size of the OS and it is different.

    Is there any way to set this property in sql server ?

  • Yes indeed - to quote from TechNet:-

    To set a fixed amount of memory

    In Object Explorer, right-click a server and select Properties.

    Click the Memory node.

    Under Server Memory Options, enter the amount that you want for Minimum server memory and Maximum server memory.

    Use the default settings to allow SQL Server to change its memory requirements dynamically based on available system resources.

    This is, of course, where you can also see what settings are currently applied.

  • The max server memory (MB) has value of 2147483647 by default and the Min server memory is 0.

    As this is pretty high value i haven't changed. I have changed the Minimum Memory for Query (KB) from default 1280 to 3000, but couldn't find any difference in the query execution or query execution plan.

    Is the property EstimatedPagesCached dependent on this memory property ?

  • You shouldn't be touching the minimum memory for query without a really, really good reason. The max server memory however should almost always be changed from the default, as few servers have over 2000 TB of memory (what the default tells SQL it should use)

    Few steps back... Why do you think that the EstimatedPagesCached property is related to the performance difference?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • The figure you've seen is the default and was what I expected once I had realised that you'd basically just followed the standard installation documentation.

    I think this opens up a few more areas for discussion.

    For clarity, is the physical server that the new instance has been installed on the actual same tin, or is it a separate machine?

    Assuming for now that we're talking about the same machine, are both instances of SQL now on there or has the new one replaced the old one?

    If two separate machines, does each only have one instance of SQL on it?

    Are there other significant differences between the two machines, regarding other applications that may be installed, or the number of connections that are being made?

    Again, if two machines, are the hard drives/storage and processors identical?

    EDIT: Oops, crossed posts with Gila there - please address her points first.

  • I have done sql server configuration in 4 to 5 systems and observed the differences in the execution plan of these systems. I could see the query execution faster where this EstimatedPagesCached is having an high value.

  • gopisrinivas.t (3/17/2015)


    I have done sql server configuration in 4 to 5 systems and observed the differences in the execution plan of these systems. I could see the query execution faster where this EstimatedPagesCached is having an high value.

    I suspect you're mixing up cause and effect.

    That value is high with inefficient execution plans, not the cause of inefficient execution plans. Can you post the plans so that we can examine the other differences?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Look to the row estimates. I'm sure that's probably the issue. The 2014 cardinality estimator is new and if you're seeing differences in execution times, it could be because of the estimates based on your statistics.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Can you post the query and both plans with estimations? As Grant said, on of the first things you have to check in such cases is new Cardinality Estimator. It is not a surprise when a query that run few seconds under 2012 needs more than a minute under SQL Server 2014.

    You can set the compatibility level of the database to 110 and then execute the query to check if it perfoms better.

    ___________________________
    Do Not Optimize for Exceptions!

  • The SQL servers are installed on 2 different VMs (Different IP Addresses).

    They have only one SQL Instance on each machine.

    The processor / ram / hard drive space is same between 2 machines.

    The machines have the same applications installed. We are running the same select query from the SQL management studio directly.

    Attaching the execution plans.

  • The SQL servers are installed on 2 different VMs (Different IP Addresses).

    They have only one SQL Instance on each machine.

    The processor / ram / hard drive space is same between 2 machines.

    The machines have the same applications installed. We are running the same select query from the SQL management studio directly.

    Attaching the execution plans.

  • The SQL servers are installed on 2 different VMs (Different IP Adresses). They have only one SQL Instance on each machine. The processor / ram / hard drive space is same between 2 machines expect the sql server. The machines have the same applications installed. We are running the same select query from the SQL managment studio directly.

    Attaching the execution plans.

Viewing 15 posts - 1 through 15 (of 26 total)

You must be logged in to reply to this topic. Login to reply