Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit a6bc111

Browse files
Merge pull request #34231 from thesqlsith/patch-4
Update alter-database-scoped-configuration-transact-sql.md
2 parents 0203980 + 711179c commit a6bc111

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

docs/t-sql/statements/alter-database-scoped-configuration-transact-sql.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Enable several database configuration settings at the individual da
55
author: markingmyname
66
ms.author: maghan
77
ms.reviewer: derekw, jovanpop, wiassaf, mariyaali
8-
ms.date: 04/17/2025
8+
ms.date: 05/28/2025
99
ms.service: sql
1010
ms.subservice: t-sql
1111
ms.topic: reference
@@ -115,6 +115,7 @@ ALTER DATABASE SCOPED CONFIGURATION
115115
| LEDGER_DIGEST_STORAGE_ENDPOINT = { <endpoint URL string> | OFF }
116116
| OPTIMIZED_SP_EXECUTESQL = { ON | OFF }
117117
| OPTIMIZED_HALLOWEEN_PROTECTION = { ON | OFF }
118+
| OPTIONAL_PARAMETER_PLAN_OPTIMIZATION = { ON | OFF }
118119
}
119120
```
120121

@@ -506,7 +507,7 @@ Causes SQL Server to generate a Showplan XML fragment with the ParameterRuntimeV
506507
507508
#### OPTIMIZED_SP_EXECUTESQL = { ON | OFF }
508509

509-
**Applies to:** [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)]
510+
**Applies to:** [!INCLUDE [sql-server-2025](../../includes/sssql25-md.md)], [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)] and [!INCLUDE [fabric-sqldb](../../includes/fabric-sqldb.md)]
510511

511512
Enables or disables the compilation serialization behavior of `sp_executesql` when a batch is compiled. The default is `OFF`. Allowing batches which use `sp_executesql` to serialize the compilation process reduces the impact of compilation storms. A compilation storms refers to a situation where a large number of queries are being compiled simultaneously, leading to performance issues and resource contention.
512513

@@ -521,6 +522,21 @@ Enables or disables [optimized Halloween protection](../../relational-databases/
521522
> [!NOTE]
522523
> For database compatibility level 160 or lower, this database scoped configuration has no effect.
523524
525+
#### OPTIONAL_PARAMETER_PLAN_OPTIMIZATION = { ON | OFF }
526+
527+
**Applies to:** [!INCLUDE [sql-server-2025](../../includes/sssql25-md.md)]
528+
529+
Enables or disables the [Optional parameter plan optimization](../../relational-databases/performance/optional-parameter-optimization.md) feature. The default is `ON`.
530+
531+
When enabled, the adaptive plan optimization generates multiple execution plans for queries that include optional parameters. These plans are typically expressed using predicates in the form of:
532+
533+
- `@p IS NULL AND @p1 IS NOT NULL`
534+
- `@p IS NULL OR @p1 IS NOT NULL`
535+
536+
The feature can choose a more optimal plan at runtime based on whether the parameter is `NULL`, which improves performance for queries that could otherwise default to suboptimal performance for such query patterns.
537+
538+
The default is `ON` starting in database compatibility level 170.
539+
524540
## Permissions
525541

526542
Requires `ALTER ANY DATABASE SCOPED CONFIGURATION` on the database. This permission can be granted by a user with `CONTROL` permission on a database.

0 commit comments

Comments
 (0)