Forum Discussion
arizona95
Dec 16, 2023Copper Contributor
execution plans and buffer pool
hi, I'm using SQL Server 2022. I just had a basic question. We all know that the execution plan describes how data is pulled from data files including if indexes are used. However, after a query is ...
arizona95
Dec 19, 2023Copper Contributor
thanks LainRobertson. However, I don't my question has been answered. When the pages get cached into the buffer, is the data pulled in the same manner that the data gets pulled from disk? For example, if the execution plan shows that an index was used, is the same index used to retrieve the data from the buffer cache?
LainRobertson
Dec 19, 2023Silver Contributor
Hi, Rob.
As per the first part of the answer, there's no unambiguous yes or no to that. The Microsoft article speaks to that variability in much greater depth than my summarisation.
A reductionist answer to your question - assuming at least that subsequent calls of the same query are within the same session as the first and no impacting SET operations have been run in between the first and subsequent calls - is that subsequent re-queries will be fetched in the same manner as the first iteration using the same query execution plan.
Cheers,
Lain