sql server - How do you fix queries that only run slow until they're cached -


I have some questions that are causing timeouts in our living environment. (> 30 seconds)

If I run a profiler and I am running precise SQL and run it from the management studio, then they take a long time to run for the first time and then run a few hundred milliseconds in each run after that.

This is clearly achieving everything in SQL caching and memory.

I am sure that there can be SEL which are optimizing which will run it faster.

My question is, how can I fix these questions when the second time I have already cached the data to run it and it's fast? According to

<, you can run the following to clear the cache:

  DBCC Draplenewsbugers dbcc freepocrack  

Edit: I have checked with the SQL Server documentation and it is at least true for SQL Server 2000.


Comments