Query Speed - First Run Slow - Next Run Very Fast
Posted on 2006-05-25
I have a number of tables. I have just created and popluated and created indexes on the NumberX tables.
When I first run the query below it took 5116 mseconds. Any further executions of the query took 16 mseconds.
select top 10 a.[id], a.num4,b.number from numbers4 a, numbers b where a.num4 = '2011' and
a.[id] = b.[id]
When I changed the numbers4 table in the query to test again all the other tables I got the same results.
I need the query to run at 16 ms the first time it is requested.
Is there some kind of Cache going on?
If i reboot the server when my application runs for the first time will I get this performace on the first query?