Skip to content

Commit cd35bfe

Browse files
committed
corrections
update SQLDB links corrections
1 parent 45f0903 commit cd35bfe

1 file changed

Lines changed: 29 additions & 37 deletions

File tree

docs/t-sql/queries/hints-transact-sql-query.md

Lines changed: 29 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ Optimized plan forcing reduces compilation overhead for repeating forced queries
181181

182182
#### EXPAND VIEWS
183183

184-
Specifies the indexed views are expanded. Also specifies the Query Optimizer won't consider any indexed view as a replacement for any query part. A view is expanded when the view definition replaces the view name in the query text.
184+
Specifies the indexed views are expanded. Also specifies the Query Optimizer doesn't consider any indexed view as a replacement for any query part. A view is expanded when the view definition replaces the view name in the query text.
185185

186186
This query hint virtually disallows direct use of indexed views and indexes on indexed views in the query plan.
187187

@@ -207,20 +207,18 @@ Force or disable the pushdown of the computation of qualifying expressions in Ha
207207

208208
#### { FORCE | DISABLE } SCALEOUTEXECUTION
209209

210-
Force or disable scale out execution of PolyBase queries that are using external tables in SQL Server 2019 Big Data Clusters. This hint will only be honored by a query using the master instance of a SQL big data cluster. The scale out will occur across the compute pool of the big data cluster.
210+
Force or disable scale out execution of PolyBase queries that are using external tables in SQL Server 2019 Big Data Clusters. This hint is only honored by a query using the master instance of a SQL Big Data Cluster. The scale out occurs across the compute pool of the big data cluster.
211211

212212
#### KEEP PLAN
213213

214214
Changes the [recompilation thresholds](../../relational-databases/statistics/statistics.md#auto_update_statistics-option) for temporary tables, and makes them identical to those for permanent tables. The estimated recompile threshold starts an automatic recompile for the query when the estimated number of indexed column changes have been made to a table by running one of the following statements:
215215

216-
#### - UPDATE
217-
218-
#### - DELETE
219-
216+
- UPDATE
217+
- DELETE
220218
- MERGE
221219
- INSERT
222220

223-
Specifying KEEP PLAN makes sure a query won't be recompiled as frequently when there are multiple updates to a table.
221+
Specifying KEEP PLAN makes sure a query isn't recompiled as frequently when there are multiple updates to a table.
224222

225223
#### KEEPFIXED PLAN
226224

@@ -236,23 +234,21 @@ Prevents the query from using a nonclustered memory optimized columnstore index.
236234

237235
**Applies to**: [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] (starting with [!INCLUDE [ssSQL11](../../includes/sssql11-md.md)] Service Pack 3, [!INCLUDE [ssSQL14](../../includes/sssql14-md.md)] Service Pack 2 and [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)].
238236

239-
The maximum memory grant size in PERCENT of configured memory limit. The query is guaranteed not to exceed this limit if the query is running in a user defined resource pool. In this case, if the query does not have the minimum required memory the system will raise an error. If a query is running in the system pool (default), then it will get at minimum the memory required to run. The actual limit can be lower if the Resource Governor setting is lower than the value specified by this hint. Valid values are between 0.0 and 100.0.
237+
The maximum memory grant size in PERCENT of configured memory limit. The query is guaranteed not to exceed this limit if the query is running in a user defined resource pool. In this case, if the query doesn't have the minimum required memory the system raises an error. If a query is running in the system pool (default), then it gets at minimum the memory required to run. The actual limit can be lower if the Resource Governor setting is lower than the value specified by this hint. Valid values are between 0.0 and 100.0.
240238

241-
The memory grant hint isn't available for index creation or rebuild.
239+
The memory grant hint isn't available for index creation or index rebuilding.
242240

243241
#### MIN_GRANT_PERCENT = <numeric_value>
244242

245243
**Applies to**: [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] (starting with [!INCLUDE [ssSQL11](../../includes/sssql11-md.md)] Service Pack 3, [!INCLUDE [ssSQL14](../../includes/sssql14-md.md)] Service Pack 2 and [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)].
246244

247245
The minimum memory grant size in PERCENT of configured memory limit. The query is guaranteed to get `MAX(required memory, min grant)` because at least required memory is needed to start a query. Valid values are between 0.0 and 100.0.
248246

249-
#### The min_grant_percent memory grant option overrides the `sp_configure` option (minimum memory per query (KB)) regardless of the size.
250-
251-
The memory grant hint isn't available for index creation or rebuild.
247+
The min_grant_percent memory grant option overrides the `sp_configure` option (minimum memory per query (KB)) regardless of the size. The memory grant hint isn't available for index creation or index rebuilding.
252248

253249
#### MAXDOP <integer_value>
254250

255-
**Applies to**: [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] (starting with [!INCLUDE [sql2008-md](../../includes/sql2008-md.md)]) and [!INCLUDE [ssSDSfull](../../includes/sssdsfull-md.md)].
251+
**Applies to**: [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] (starting with [!INCLUDE [sql2008-md](../../includes/sql2008-md.md)]) and [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)].
256252

257253
Overrides the **max degree of parallelism** configuration option of `sp_configure`. Also overrides the Resource Governor for the query specifying this option. The MAXDOP query hint can exceed the value configured with `sp_configure`. If MAXDOP exceeds the value configured with Resource Governor, the [!INCLUDE [ssDE](../../includes/ssde-md.md)] uses the Resource Governor MAXDOP value, described in [ALTER WORKLOAD GROUP (Transact-SQL)](../statements/alter-workload-group-transact-sql.md). All semantic rules used with the **max degree of parallelism** configuration option are applicable when you use the MAXDOP query hint. For more information, see [Configure the max degree of parallelism Server Configuration Option](../../database-engine/configure-windows/configure-the-max-degree-of-parallelism-server-configuration-option.md).
258254

@@ -271,7 +267,7 @@ For more information, see [WITH common_table_expression (Transact-SQL)](../queri
271267

272268
#### NO_PERFORMANCE_SPOOL
273269

274-
**Applies to**: [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] (starting with [!INCLUDE [sssql16-md](../../includes/sssql16-md.md)]) and [!INCLUDE [ssSDSfull](../../includes/sssdsfull-md.md)].
270+
**Applies to**: [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] (starting with [!INCLUDE [sssql16-md](../../includes/sssql16-md.md)]) and [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)].
275271

276272
Prevents a spool operator from being added to query plans (except for the plans when spool is required to guarantee valid update semantics). The spool operator may reduce performance in some scenarios. For example, the spool uses `tempdb`, and `tempdb` contention can occur if there are many concurrent queries running with the spool operations.
277273

@@ -297,7 +293,7 @@ OPTIMIZE FOR can counteract the optimizer's default parameter detection behavior
297293

298294
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.
299295

300-
If you use `OPTIMIZE FOR @variable_name = <literal_constant>` and `OPTIMIZE FOR UNKNOWN` in the same query hint, the Query Optimizer will use the *literal_constant* specified for a specific value. The Query Optimizer will use UNKNOWN for the rest of the variable values. The values are used only during query optimization, and not during query execution.
296+
If you use `OPTIMIZE FOR @variable_name = <literal_constant>` and `OPTIMIZE FOR UNKNOWN` in the same query hint, the Query Optimizer uses the *literal_constant* specified for a specific value. The Query Optimizer uses UNKNOWN for the rest of the variable values. The values are used only during query optimization, and not during query execution.
301297

302298
#### PARAMETERIZATION { SIMPLE | FORCED }
303299

@@ -314,7 +310,7 @@ SIMPLE instructs the Query Optimizer to attempt simple parameterization. FORCED
314310

315311
This option lets you enable a plan-affecting trace flag only during single-query compilation. Like other query-level options, you can use it together with plan guides to match the text of a query being executed from any session, and automatically apply a plan-affecting trace flag when this query is being compiled. The QUERYTRACEON option is only supported for Query Optimizer trace flags. For more information, see [Trace Flags](../database-console-commands/dbcc-traceon-trace-flags-transact-sql.md).
316312

317-
Using this option won't return any error or warning if an unsupported trace flag number is used. If the specified trace flag isn't one that affects a query execution plan, the option will be silently ignored.
313+
Using this option won't return any error or warning if an unsupported trace flag number is used. If the specified trace flag isn't one that affects a query execution plan, the option is silently ignored.
318314

319315
To use more than one trace flag in a query, specify one QUERYTRACEON hint for each different trace flag number.
320316

@@ -332,7 +328,7 @@ If such a plan isn't possible, the Query Optimizer returns an error instead of d
332328

333329
#### <a id="use_hint"></a> USE HINT ( '*hint_name*' )
334330

335-
**Applies to**: [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] (starting with [!INCLUDE [sssql16-md](../../includes/sssql16-md.md)] SP1) and [!INCLUDE [ssSDSfull](../../includes/sssdsfull-md.md)].
331+
**Applies to**: [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] (starting with [!INCLUDE [sssql16-md](../../includes/sssql16-md.md)] SP1) and [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)].
336332

337333
Provides one or more additional hints to the query processor. The additional hints are specified by a hint name **inside single quotation marks**.
338334

@@ -350,37 +346,37 @@ The following hint names are supported:
350346

351347
Causes [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] to generate a plan using maximum selectivity when estimating AND predicates for filters to account for full independence. This hint name is the default behavior of the cardinality estimation model of [!INCLUDE [ssSQL11](../../includes/sssql11-md.md)] and earlier versions, and equivalent to [trace flag](../database-console-commands/dbcc-traceon-trace-flags-transact-sql.md) 9472 when used with cardinality estimation model of [!INCLUDE [ssSQL14](../../includes/sssql14-md.md)] or higher.
352348

353-
**Applies to**: [!INCLUDE [ssSDSfull](../../includes/sssdsfull-md.md)]
349+
**Applies to**: [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)]
354350

355351
- 'ASSUME_PARTIAL_CORRELATION_FOR_FILTER_ESTIMATES'
356352

357353
Causes [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] to generate a plan using most to least selectivity when estimating AND predicates for filters to account for partial correlation. This hint name is the default behavior of the cardinality estimation model of [!INCLUDE [ssSQL14](../../includes/sssql14-md.md)] or higher.
358354

359-
**Applies to**: [!INCLUDE [ssSDSfull](../../includes/sssdsfull-md.md)]
355+
**Applies to**: [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)]
360356

361357
- 'DISABLE_BATCH_MODE_ADAPTIVE_JOINS'
362358

363359
Disables batch mode adaptive joins. For more information, see [Batch mode Adaptive Joins](../../relational-databases/performance/intelligent-query-processing-details.md#batch-mode-adaptive-joins).
364360

365-
**Applies to**: [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] (starting with [!INCLUDE [ssSQL17](../../includes/sssql17-md.md)]) and [!INCLUDE [ssSDSfull](../../includes/sssdsfull-md.md)]
361+
**Applies to**: [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] (starting with [!INCLUDE [ssSQL17](../../includes/sssql17-md.md)]) and [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)]
366362

367363
- 'DISABLE_BATCH_MODE_MEMORY_GRANT_FEEDBACK'
368364

369365
Disables batch mode memory grant feedback. For more information, see [Batch mode memory grant feedback](../../relational-databases/performance/intelligent-query-processing-feedback.md#batch-mode-memory-grant-feedback).
370366

371-
**Applies to**: [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] (starting with [!INCLUDE [ssSQL17](../../includes/sssql17-md.md)]) and [!INCLUDE [ssSDSfull](../../includes/sssdsfull-md.md)]
367+
**Applies to**: [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] (starting with [!INCLUDE [ssSQL17](../../includes/sssql17-md.md)]) and [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)]
372368

373369
- 'DISABLE_DEFERRED_COMPILATION_TV'
374370

375371
Disables table variable deferred compilation. For more information, see [Table variable deferred compilation](../../relational-databases/performance/intelligent-query-processing-details.md#table-variable-deferred-compilation).
376372

377-
**Applies to**: [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] (starting with [!INCLUDE [sql-server-2019](../../includes/sssql19-md.md)]) and [!INCLUDE [ssSDSfull](../../includes/sssdsfull-md.md)]
373+
**Applies to**: [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] (starting with [!INCLUDE [sql-server-2019](../../includes/sssql19-md.md)]) and [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)]
378374

379375
- 'DISABLE_INTERLEAVED_EXECUTION_TVF'
380376

381377
Disables interleaved execution for multi-statement table-valued functions. For more information, see [Interleaved execution for multi-statement table-valued functions](../../relational-databases/performance/intelligent-query-processing-details.md#interleaved-execution-for-mstvfs).
382378

383-
**Applies to**: [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] (starting with [!INCLUDE [ssSQL17](../../includes/sssql17-md.md)]) and [!INCLUDE [ssSDSfull](../../includes/sssdsfull-md.md)]
379+
**Applies to**: [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] (starting with [!INCLUDE [ssSQL17](../../includes/sssql17-md.md)]) and [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)]
384380

385381
- 'DISABLE_OPTIMIZED_NESTED_LOOP'
386382

@@ -390,12 +386,10 @@ The following hint names are supported:
390386

391387
Causes SQL Server to generate a plan that doesn't use row goal modifications with queries that contain these keywords:
392388

393-
#### - TOP
394-
395-
#### - OPTION (FAST N)
396-
389+
- TOP
390+
- OPTION (FAST N)
397391
- IN
398-
- EXISTS
392+
- EXISTS
399393

400394
This hint name is equivalent to [trace flag](../database-console-commands/dbcc-traceon-trace-flags-transact-sql.md) 4138.
401395

@@ -407,19 +401,19 @@ The following hint names are supported:
407401

408402
Disables row mode memory grant feedback. For more information, see [Row mode memory grant feedback](../../relational-databases/performance/intelligent-query-processing-feedback.md#row-mode-memory-grant-feedback).
409403

410-
**Applies to**: [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] (starting with [!INCLUDE [sql-server-2019](../../includes/sssql19-md.md)]) and [!INCLUDE [ssSDSfull](../../includes/sssdsfull-md.md)]
404+
**Applies to**: [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] (starting with [!INCLUDE [sql-server-2019](../../includes/sssql19-md.md)]) and [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)]
411405

412406
- 'DISABLE_TSQL_SCALAR_UDF_INLINING'
413407

414408
Disables scalar UDF inlining. For more information, see [Scalar UDF Inlining](../../relational-databases/user-defined-functions/scalar-udf-inlining.md).
415409

416-
**Applies to**: [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] (starting with [!INCLUDE [sql-server-2019](../../includes/sssql19-md.md)]) and [!INCLUDE [ssSDSfull](../../includes/sssdsfull-md.md)]
410+
**Applies to**: [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] (starting with [!INCLUDE [sql-server-2019](../../includes/sssql19-md.md)]) and [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)]
417411

418412
- 'DISALLOW_BATCH_MODE'
419413

420414
Disables batch mode execution. For more information, see [Execution modes](../../relational-databases/query-processing-architecture-guide.md#execution-modes).
421415

422-
**Applies to**: [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] (starting with [!INCLUDE [sql-server-2019](../../includes/sssql19-md.md)]) and [!INCLUDE [ssSDSfull](../../includes/sssdsfull-md.md)]
416+
**Applies to**: [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] (starting with [!INCLUDE [sql-server-2019](../../includes/sssql19-md.md)]) and [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)]
423417

424418
- 'ENABLE_HIST_AMENDMENT_FOR_ASC_KEYS'
425419

@@ -441,7 +435,7 @@ The following hint names are supported:
441435

442436
Forces the Query Optimizer behavior at a query level. This behavior happens as if the query was compiled with database compatibility level *n*, where *n* is a supported database compatibility level (for example 100, 130, etc.). Refer to [sys.dm_exec_valid_use_hints](../../relational-databases/system-dynamic-management-views/sys-dm-exec-valid-use-hints-transact-sql.md) for a list of currently supported values for *n*.
443437

444-
**Applies to**: [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] (starting with [!INCLUDE [ssSQL17](../../includes/sssql17-md.md)] CU10) and [!INCLUDE [ssSDSfull](../../includes/sssdsfull-md.md)]
438+
**Applies to**: [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] (starting with [!INCLUDE [ssSQL17](../../includes/sssql17-md.md)] CU10) and [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)]
445439

446440
> [!NOTE]
447441
> The QUERY_OPTIMIZER_COMPATIBILITY_LEVEL_n hint doesn't override default or legacy cardinality estimation setting, if it's forced through database scoped configuration, trace flag or another query hint such as QUERYTRACEON.
@@ -486,7 +480,7 @@ Applies the specified table hint to the table or view that corresponds to *expos
486480

487481
When you specify *exposed_object_name* without also specifying a table hint, any indexes you specify in the query as part of a table hint for the object are disregarded. The Query Optimizer then determines index usage. You can use this technique to eliminate the effect of an INDEX table hint when you can't modify the original query. See Example J.
488482

489-
#### <table_hint> ::= {
483+
<table_hint> ::= {
490484

491485
NOEXPAND [ , INDEX ( *<index_value>* [ ,...n ] ) | INDEX = ( *<index_value>* ) ] | INDEX ( *<index_value>* [ ,...n ] ) | INDEX = ( *<index_value>* ) | FORCESEEK [(*<index_value>*(*<index_column_name>* [,... ] ) ) ] | FORCESCAN | HOLDLOCK | NOLOCK | NOWAIT | PAGLOCK | READCOMMITTED | READCOMMITTEDLOCK | READPAST | READUNCOMMITTED | REPEATABLEREAD | ROWLOCK | SERIALIZABLE | SNAPSHOT | SPATIAL_WINDOW_MAX_CELLS = *<integer_value>* | TABLOCK | TABLOCKX | UPDLOCK | XLOCK }
492486

@@ -509,10 +503,8 @@ We recommend using the INDEX, FORCESCAN, or FORCESEEK table hint as a query hint
509503

510504
When specified as a query hint, the INDEX, FORCESCAN, and FORCESEEK table hints are valid for the following objects:
511505

512-
#### - Tables
513-
514-
#### - Views
515-
506+
- Tables
507+
- Views
516508
- Indexed views
517509
- Common table expressions (the hint must be specified in the SELECT statement whose result set populates the common table expression)
518510
- Dynamic Management Views (DMVs)

0 commit comments

Comments
 (0)