mirror of
https://github.com/Microsoft/sql-server-samples.git
synced 2025-12-08 14:58:54 +00:00
22 lines
420 B
Transact-SQL
22 lines
420 B
Transact-SQL
-- Sort Spill
|
|
|
|
-- Get Actual Execution Plan
|
|
|
|
USE AdventureWorks2014
|
|
--USE AdventureWorks2016CTP3
|
|
GO
|
|
--Execute
|
|
DBCC FREEPROCCACHE
|
|
GO
|
|
SELECT *
|
|
FROM Sales.SalesOrderDetail SOD
|
|
INNER JOIN Production.Product P ON SOD.ProductID = P.ProductID
|
|
ORDER BY Style
|
|
OPTION (QUERYTRACEON 9481)
|
|
GO
|
|
|
|
/*
|
|
Observe the type of Spill = 1
|
|
Means one pass over the data was enough to complete the sort in the Worktable
|
|
*/
|