OPTIMIZE FOR query hint is used to optimize queries based on a specific value for a local variable used in the query.
FAST query hint optimizes the query to quickly retrieve a specified number of rows. DBA/Developer would use the FAST query hint to quickly return a fewer number of rows from a large table. For example, DBA/Developer might use the following query to quickly retrieve the first 200 rows from the Products table:
SELECT *
FROM ProductHistoryORDER BY ProdStyle
DESCOPTION (FAST 200);
When this query executes, the first 200 rows in the result set will be returned as quickly as possible, and then the query will return the remainder of the result set when the query completes.
FORCE ORDER query hint controls how the query's join order is handled when a query is being optimized. Specifying FORCE ORDER indicates that query optimization will not affect the join order specified in the query.
No comments:
Post a Comment