Article ID: 2009160 - View products that this article applies to.
After upgrading from SQL Server 2000 to either SQL Server 2005 or SQL Server 2008, you may notice some queries may consume more CPU in the new environment. Furthermore, you will notice the query plan has OPTIMIZED keyword. For an example on a query plan that exhibits this behavior refer to the following blog:
In some cases, SQL Server 2005 and SQL Server 2008 query processor may introduce a sort operation for optimization though it is not required. In these cases wherein the particular plan only touches a smaller number of rows, the setup cost for the sort operation may outweigh its benefits thus resulting in poor performance.
You can use trace flag 2340 to disable this particular optimization. But before you use this trace flag, we recommend that you test your applications thoroughly to make sure that you indeed get the expected performance benefits when disabling this optimization. This is because the sort optimization can be very beneficial in cases where there is a substantial increase in the number of rows touched by the plan.
For more information about how to enable a trace flag as a startup option, visit the following MSDN Web site:
(http://go.microsoft.com/fwlink/?LinkId=151500)for other considerations.
Article ID: 2009160 - Last Review: January 13, 2010 - Revision: 2.0