SQL Server 執行計畫

2022-01-29 09:53:57 字數 613 閱讀 9010

預讀、邏輯讀、物理讀的解釋

預讀:sql server查詢的時候會在記憶體中生成查詢計畫,但在同時會去硬碟上取估計的資料放入快取

邏輯讀:從快取中讀取資料

物理讀:當快取中也沒有的時候,就回去硬碟讀

檢視語句執**況

set statistics profile on

set statistics io on

set statistics time on

go《這裡寫上你的語句

...>

goset statistics profile off

set statistics io off

set statistics time off

for example:

set statistics io on

set statistics time on

goselect *  from tbl_meetingroomorder

goset statistics profile off

set statistics io off

set statistics time off

SQL Server 執行計畫

預讀 邏輯讀 物理讀的解釋 預讀 sql server查詢的時候會在記憶體中生成查詢計畫,但在同時會去硬碟上取估計的資料放入快取 邏輯讀 從快取中讀取資料 物理讀 當快取中也沒有的時候,就回去硬碟讀 檢視語句執 況 set statistics profile on set statistics i...

Sql Server 執行計畫

1.每次執行sql語句都會生成執行計畫並快取起來,因為生成執行計畫也需要時間開銷,因此重用執行計畫將能提高效能,並節省緩衝區空間。我們可以使用sys.dm exec cached plans sys.dm exec sql text sys.dm exec query plan來查詢快取的執行計畫。...

sqlserver 執行計畫

執行計畫查詢語句 set statistics profile on sql statement setstatistics profile off 示例 set statistics profile on select from t e base elec where collecttime 20...