November 10, 2009 at 5:00 am
Hi,
Is SQL Server going to store the data of the recently executed queries in IN MEMORY?
For Example:
If we have a Procedure with multiple select statements which takes much time to get executed and gives the output after the execution of the SP.
Then SQL Server should have stored the output of the previously executed selected statements in IN MEMORY and displayed the output after the completion of the Stored Procedure.
Thanks
Deeps
November 10, 2009 at 7:24 am
SQL Server does cache data in memory. If you use SET STATISTICS IO ON and view the results logical reads are reads from memory while physical reads are when SQL Server goes to disk. You can't guarantee that the results will be in memory, as SQL Server does age results out of cache IF there is any memory pressure.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
November 10, 2009 at 7:36 am
Short answer: No.
SQL caches data from tables and query execution plans, but it doesn't cache query results.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 10, 2009 at 7:42 am
Okay, so the specific query results are NOT cached, but the data pages that are required to fulfill the needs of the query are cached.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
November 10, 2009 at 8:33 am
Thanks Jack and Monster 🙂
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply