I am running SQL Server 2008 and have a query that takes about 10 seconds to load the very first time... but then subsequent runs of that query take only 1 second or so. I believe this is due to query plan caching. When I execute sub-sequent runs of the query using the "DBCC FREEPROCCACHE" statement first, then it takes 10 seconds each time.
Anyways, I have a website which this query is executed on and I was wondering how I can go about saving that query execution plan so that it doesn't need to figure it out for the first visit to that page each time. All other queries on the site load quickly. Is it possible to save a query plan and not have it removed from cache?
Thanks in advance!