This might seem a basic thing but bothering me from last few days.
Suppose I have a table containing 5 million records and I am running queries one by one (one query executes completly and then next query is fired)as below on that table.
SELECT top 20000 FROM MyTable SELECT top 200000 FROM MyTable SELECT top 2000000 FROM MyTable
Now my questions are;
Will SQL Server use same execution plan? As I am running these queries one by one in same order as given above, will second query take less time than it should if run standalone (only second query is fired, no query fired before that) and similarly will third query take less time than it should
if run standalone (only third query is fired, no query fired before that), since there is a possibility of same execution plan being used?
View Complete Post