I noticed that when optimising a query it can be quite difficult. SQL server caches table information so it can be difficult to test how fast a query is running.
To clearr the cache, run the following query;
--Remove execution plan cache
DBCC FREEPROCCACHE
GO
--Remove data cache
DBCC DROPCLEANBUFFERS
GO
Please note, you should never do this on a live server!!
No comments:
Post a Comment