Home Forums SQL Server 2008 SQL Server 2008 - General Massive slowdown in SELECT statement in Cursor from SQL 2000 to 2008 -- need help! RE: Massive slowdown in SELECT statement in Cursor from SQL 2000 to 2008 -- need help!

  • I'm still trying to make heads and tails out of what covering indexes do. I've got a dozen non-unique, non-clustered indexes in SVSales, including the primary key. The SELECT statement in my query is referencing SaleDate and OrgNum in SVSales, but SVSales joins to SVAccounts using INum and FullAcctNum, and it joins to SVGoalProdXref using INum and ProdNum. So I'm not sure what I use for the Covered Index. I think you mentioned INum, ProdNum and FullAcctNum, and potentially SaleDate. I have other fields that are indexed that join to other tables, such as GroupOrgNum, but that goes to a table NOT shown in my SELECT (since I didn't need to use it). Does GroupOrgNum also get added to the Covered index, or do I leave it out? The interesting thing is that my query cost in my execution plan is 100%, and another site suggested that a Covered Index could lower it. I apologize, but Covered Indexes are new to me. The crazy thing is that my query works in seconds on SQL Server 2000, and in 2008 it takes minutes--so maddening!