FORCESEEK
FORCESEEK [ (index_value(index_column_name [ ,... n ] )) ]
Use the FORCESEEK hint to Specify the query optimizer use only an index seek operation.
SELECT ..... FROM Sales.SalesOrderHeader h
INNER JOIN Sales.SalesOrderDetail AS d WITH (FORCESEEK)
ON h.SalesOrderID = d.SalesOrderID .......
SELECT ..... FROM Sales.SalesOrderHeader h
INNER JOIN Sales.SalesOrderDetail AS d WITH (FORCESEEK (INDEX_NAME ((COLUMN_NAME)))
ON h.SalesOrderID = d.SalesOrderID .......
FORCESCAN
Use the FORCESCAN hint to force the query optimizer to perform a scan operation
SELECT ..... FROM Sales.SalesOrderHeader h
INNER JOIN Sales.SalesOrderDetail AS d WITH (FORCESCAN)
ON h.SalesOrderID = d.SalesOrderID .......
No comments:
Post a Comment