When we want to analyze the execution plan of some statements after a certain amount of data, it is possible to simulate the data and forge a large amount of data. However, this work is actually quite difficult. After a friend introduced me on the internet, I can see the following method of false statistics. It is very convenient to analyze the execution plan only.
Use tempdb
Go
Create Table T1 (I int, J INT)
Go
Create Table T2 (H int, k int)
Go
Set statistics profile on
Go
Select distinct (I) from T1
Go
Select * from T1, T2 where I = K order by J + k
Go
Update statistics T1 with rowcount = 10000, pagecount = 10000
Update statistics T2 with rowcount = 100000, pagecount = 100000
Go
Select distinct (I) from T1 option (recompile)
Go
Select * from T1, T2 where I = K order by J + k option (recompile)
If no recomplite is added to the SELECT statement, clear the cache: DBCC freeproccache.
From: http://blogs.msdn.com/ B /queryoptteam/archive/2006/07/21/674350.aspx