March 2, 2008 at 10:00 pm
I have a query that accesses a table with a non-clustered index. When I drop the index and run the query, it takes 1.25 minutes to run. With the index, it takes 2 seconds to run. Yet, the execution plan is the same with or without the index. How can that be?
Thank you!
March 3, 2008 at 3:03 am
How are you viewing the execution plan?
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
March 3, 2008 at 8:37 am
Is it possible that it is running faster the second time simply because the data is now in RAM cache?
I agree with Gila's question - how exactly are you determining the query plan?
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
March 4, 2008 at 12:59 am
Good point. It could very well be that.
Set Statistics IO ON and then do your tests. Check the logical and physical IOs. Physical means it reads from disk, logical just from memory.
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
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply