In this article, I'm gonna list some cool tricks with SQL Server using some undocumented stored procedure.
Clear database cache
As you may already know, SQL normally use cache to speed up queries that are often executed. This is no doubt a very cool feature of SQL Server.
However, sometimes when you are tuning your query, SQL Server caches your query or part of it so you can't decide if your query is really fast or is it just fast because SQL Server fetch the result from cache. In this case, you may want to clear SQL Server cache so that the query result is fetched directly from database.
Here comes the command to clear cache
dbcc dropcleanbuffers
That's it. Now execute your query again to see how it performs :D
Hope this helps.
Cheers!