Hints: query, table, join
57 reference entries
- Hints (overview)
none (documentation, rules or examples)
- JOIN HINT { LOOP | HASH | MERGE }
Applies to: Azure SQL Database, Azure SQL Managed Instance, SQL analytics endpoint in Microsoft Fabric, SQL database in Microsoft Fabric, Microsoft Fabric Warehouse in Microsoft Fabric
- JOIN HINT REMOTE
Applies to: Azure SQL Database, Azure SQL Managed Instance, SQL analytics endpoint in Microsoft Fabric, SQL database in Microsoft Fabric
- Join hints
forces physical join strategy
- QUERY HINT { FORCE | DISABLE } EXTERNALPUSHDOWN
Force or disable the pushdown of the computation of qualifying expressions in Hadoop.
- QUERY HINT { FORCE | DISABLE } SCALEOUTEXECUTION
Force or disable scale-out execution of PolyBase queries that are using external tables in SQL Server 2019 Big Data Clusters.
- QUERY HINT { HASH | ORDER } GROUP
Specifies that aggregations that the query's GROUP BY or DISTINCT clause describes should use hashing or ordering.
- QUERY HINT { LOOP | MERGE | HASH } JOIN
Specifies that all join operations are performed by LOOP JOIN, MERGE JOIN, or HASH JOIN in the whole query.
- QUERY HINT { MERGE | HASH | CONCAT } UNION
Specifies that all UNION operations are run by merging, hashing, or concatenating UNION sets.
- QUERY HINT DISABLE_OPTIMIZED_PLAN_FORCING
Disables Optimized plan forcing for a query.
- QUERY HINT EXPAND VIEWS
Specifies the indexed views are expanded.
- QUERY HINT FAST integer_value
Specifies that the query is optimized for fast retrieval of the first integer_value number of rows.
- QUERY HINT FORCE ORDER
Specifies that the join order indicated by the query syntax is preserved during query optimization.
- QUERY HINT IGNORE_NONCLUSTERED_COLUMNSTORE_INDEX
Prevents the query from using a nonclustered memory optimized columnstore index.
- QUERY HINT KEEP PLAN
Changes the recompilation thresholds for temporary tables, and makes them identical to the thresholds for permanent tables.
- QUERY HINT KEEPFIXED PLAN
Forces the Query Optimizer not to recompile a query because of changes in statistics.
- QUERY HINT MAX_GRANT_PERCENT = <numeric_value>
The maximum memory grant size in PERCENT of configured memory limit.
- QUERY HINT MAXDOP <integer_value>
Overrides the max degree of parallelism configuration option of sp_configure.
- QUERY HINT MAXRECURSION <integer_value>
Specifies the maximum number of recursions allowed for this query.
- QUERY HINT MIN_GRANT_PERCENT = <numeric_value>
The minimum memory grant size in PERCENT of configured memory limit.
- QUERY HINT NO_PERFORMANCE_SPOOL
Prevents a spool operator from being added to query plans (except for the plans when spool is required to guarantee valid update semantics).
- QUERY HINT OPTIMIZE FOR ( @variable_name { UNKNOWN | = <literal_constant> } [ , ...n ] )
Instructs the Query Optimizer to use a particular value for a local variable when the query is compiled and optimized.
- QUERY HINT OPTIMIZE FOR UNKNOWN
Instructs the Query Optimizer to use the average selectivity of the predicate across all column values, instead of using the runtime parameter value when the query is compiled and optimized.
- QUERY HINT PARAMETERIZATION { SIMPLE | FORCED }
Specifies the parameterization rules that the SQL Server Query Optimizer applies to the query when it compiles.
- QUERY HINT QUERYTRACEON <integer_value>
This option lets you enable a plan-affecting trace flag only during single-query compilation.
- QUERY HINT RECOMPILE
Instructs the SQL Server Database Engine to generate a new, temporary plan for the query and immediately discard that plan after the query completes execution.
- QUERY HINT ROBUST PLAN
Forces the Query Optimizer to try a plan that works for the maximum potential row size, possibly at the expense of performance.
- QUERY HINT TABLE HINT ( exposed_object_name [ , <table_hint> [ [ , ] ...n ] ] )
Applies the specified table hint to the table or view that corresponds to exposed_object_name.
- QUERY HINT USE HINT ( 'hint_name' )
Provides one or more extra hints to the query processor.
- QUERY HINT USE PLAN N'xml_plan'
Forces the Query Optimizer to use an existing query plan for a query specified by xml_plan.
- Query hints
statement-wide optimizer and execution constraints in OPTION (...)
- TABLE HINT FORCESCAN
Specifies that the query optimizer uses only an index scan operation as the access path to the referenced table or view.
- TABLE HINT FORCESEEK [ ( <index_value> ( <index_column_name> [ , ...n ] ) ) ]
Specifies that the query optimizer uses only an index seek operation as the access path to the data in the table or view.
- TABLE HINT HOLDLOCK
Equivalent to SERIALIZABLE.
- TABLE HINT IGNORE_CONSTRAINTS
Applicable only in an INSERT statement when the BULK option is used with OPENROWSET (BULK).
- TABLE HINT IGNORE_TRIGGERS
Applicable only in an INSERT statement when the BULK option is used with OPENROWSET (BULK).
- TABLE HINT INDEX ( <index_value> [ , ...n ] ) | INDEX = ( <index_value> )
The INDEX() syntax specifies the names or IDs of one or more indexes to be used by the query optimizer when it processes the statement.
- TABLE HINT KEEPDEFAULTS
Applicable only in an INSERT statement when the BULK option is used with OPENROWSET (BULK).
- TABLE HINT KEEPIDENTITY
Applicable only in an INSERT statement when the BULK option is used with OPENROWSET(BULK).
- TABLE HINT NOEXPAND
Specifies that any indexed views aren't expanded to access underlying tables when the query optimizer processes the query.
- TABLE HINT NOLOCK
Equivalent to READUNCOMMITTED.
- TABLE HINT NOWAIT
Instructs the Database Engine to return a message as soon as a lock is encountered on the table.
- TABLE HINT PAGLOCK
Takes page locks either where individual locks are ordinarily taken on rows or keys, or where a single table lock is ordinarily taken.
- TABLE HINT READCOMMITTED
Specifies that read operations comply with the rules for the READ COMMITTED isolation level by using either locking or row versioning.
- TABLE HINT READCOMMITTEDLOCK
Specifies that read operations comply with the rules for the READ COMMITTED isolation level by using locking.
- TABLE HINT READPAST
Specifies that the Database Engine not read rows that are locked by other transactions.
- TABLE HINT READUNCOMMITTED
Specifies that dirty reads are allowed.
- TABLE HINT REPEATABLEREAD
Specifies that a scan is performed with the same locking semantics as a transaction running at REPEATABLE READ isolation level.
- TABLE HINT ROWLOCK
Specifies that row locks are taken when page or table locks are ordinarily taken.
- TABLE HINT SERIALIZABLE
Equivalent to HOLDLOCK.
- TABLE HINT SNAPSHOT
The memory-optimized table is accessed under SNAPSHOT isolation.
- TABLE HINT SPATIAL_WINDOW_MAX_CELLS = <integer_value>
Specifies the maximum number of cells to use for tessellating a geometry or geography object.
- TABLE HINT TABLOCK
Specifies that the acquired lock is applied at the table level.
- TABLE HINT TABLOCKX
Specifies that an exclusive lock is taken on the table.
- TABLE HINT UPDLOCK
Specifies that update locks are to be taken and held until the transaction completes.
- TABLE HINT XLOCK
Specifies that exclusive locks are to be taken and held until the transaction completes.
- Table hints
per-table access method, locking or isolation override