You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[!INCLUDE [sssql19-starting-md](../../includes/sssql19-starting-md.md)], this configuration setting is used by [accelerated database recovery](../../relational-databases/accelerated-database-recovery-concepts.md).
19
20
20
-
Accelerated database recovery (ADR) uses row versions for transaction management and database recovery purposes. These versions are generated as part of various data manipulation language (DML) operations. Versions are stored in an internal table called the persistent version store (PVS).
21
+
Accelerated database recovery (ADR) uses row versions for transaction management and database recovery purposes. These versions are generated as part of various data manipulation language (DML) operations. Versions are stored either in-row, or off-row in an internal table called the persistent version store (PVS).
21
22
22
23
## Remarks
23
24
24
-
Performance can degrade if pages are allocated for persistent version store (PVS) as part of foreground user DML operations. A background thread preallocates pages, and keeps them readily available for DML transactions. Performance is optimal when the background thread preallocates enough pages that the percentage of foreground PVS allocations is close to 0. The error log contains entries with the tag `PreallocatePVS` if the percentage gets high enough to affect performance.
25
+
Performance can degrade if pages are allocated for persistent version store (PVS) as part of foreground user DML operations. A background thread preallocates pages, and keeps them readily available for inserts into PVS. Performance is optimal when the background thread preallocates enough pages that the percentage of foreground PVS allocations is close to 0.
25
26
26
27
The number of pages the background thread preallocates is based on various workload heuristics. Commonly, the background thread allocates chunks of 512 pages. The ADR preallocation factor is a multiple of the chunk. By default, the factor is `4`, which means that 2048 pages are preallocated at once when required.
27
28
28
-
While the background thread takes workload patterns into consideration, this factor can be increased if necessary to improve performance.
29
+
While the background thread takes workload patterns into consideration, this factor can be increased if necessary to improve performance. The `tx_version_optimized_insert_stats` extended event fires every few minutes and includes the `foreground_allocation_percent` field. If the value in this field is significantly higher than zero, consider increasing the `ADR Preallocation Factor` setting.
29
30
30
-
> [!CAUTION]
31
+
> [!WARNING]
31
32
> If PVS preallocation factor is increased too much, it can contend with other allocations in the system and might actually reduce overall performance. Before you modify this setting, obtain a baseline of the system performance for tracking and comparison purposes.
@@ -145,7 +145,7 @@ The four key components of ADR are:
145
145
146
146
## Workloads that benefit from ADR
147
147
148
-
ADR is particularly beneficial for workloads that have:
148
+
ADR benefits most workloads, and is particularly beneficial for workloads that have:
149
149
150
150
- Long-running transactions.
151
151
- Active transactions that cause the transaction log to grow significantly.
@@ -155,15 +155,15 @@ ADR isn't supported in databases using [database mirroring](../database-engine/d
155
155
156
156
## Best practices for ADR
157
157
158
-
- Avoid unnecessary long-running transactions. Though ADR speeds up database recovery even with long-running transactions, such transactions can delay version cleanup and increase the size of the PVS.
158
+
- Avoid unnecessary long-running transactions. Though ADR speeds up database recovery even with long-running transactions, such transactions can delay version cleanup and increase PVS size.
159
159
160
160
- Avoid large transactions that include DDL operations. ADR uses the secondary log stream (SLOG) mechanism to track DDL operations used in recovery. SLOG is only used while the transaction is active. SLOG is checkpointed, so avoiding large transactions that use SLOG can help the overall performance. These scenarios can cause the SLOG to take up more space:
161
161
- Many DDLs are executed in one transaction. For example, in one transaction, rapidly creating and dropping temp tables.
162
162
- A table has very large number of partitions/indexes that are modified. For example, a `DROP TABLE` operation on such table would require a large reservation of SLOG memory, which would delay truncation of the transaction log and delay undo/redo operations. As a workaround, drop the indexes individually and gradually, then drop the table.
163
163
164
164
For more information about SLOG, see [ADR recovery components](#adr-recovery-components).
165
165
166
-
- Prevent or reduce unnecessary aborted transactions. A high transaction abort rate puts pressure on the PVS cleaner and lower ADR performance. The aborts might come from a high rate of deadlocks, duplicate keys, constraint violations, or query timeouts.
166
+
- Prevent or reduce unnecessary aborted transactions. A high transaction abort rate puts pressure on the PVS cleaner and lowers ADR performance. The aborts might come from a high rate of deadlocks, duplicate keys, constraint violations, query timeouts, or other exceptions.
167
167
The [sys.dm_tran_aborted_transactions](system-dynamic-management-views/sys-dm-tran-aborted-transactions.md) DMV shows all aborted transactions on the database engine instance. The `nested_abort` column indicates that the transaction committed but there are portions that aborted (savepoints or nested transactions) which can also delay the PVS cleanup process.
168
168
169
169
- Ensure there's sufficient space in the database to account for PVS usage. If the database doesn't have enough room for PVS to grow, ADR might fail to generate versions, causing DML statements to fail.
@@ -174,9 +174,7 @@ ADR isn't supported in databases using [database mirroring](../database-engine/d
174
174
175
175
If using [CDC](/azure/azure-sql/database/change-data-capture-overview) or [change feed](/azure/synapse-analytics/synapse-link/sql-database-synapse-link) in Azure SQL Database, you might need to increase your service tier or compute size to ensure that sufficient transaction log space is available for the needs of all your workloads. Similarly, in Azure SQL Managed Instance you might need to increase your instance maximum storage size.
176
176
177
-
- For [!INCLUDE[ssNoVersion](../includes/ssnoversion-md.md)], isolate the PVS version store on a filegroup on higher tier storage, such as high-end SSD or advanced SSD or Persistent Memory (PMEM), sometimes referred to as Storage Class Memory (SCM). For more information, see [Change the location of the PVS to a different filegroup](accelerated-database-recovery-management.md#change-the-pvs-filegroup).
178
-
179
-
- For [!INCLUDE[ssNoVersion](../includes/ssnoversion-md.md)], monitor the error log for `PreallocatePVS` entries. If `PreallocatePVS` entries are present, you might need to increase the ADR ability to preallocate pages using a background task. Preallocating PVS pages in background improves ADR performance by reducing more expensive foreground PVS allocations. You can use the `ADR Preallocation Factor` server configuration to increase this amount. For more information, see [Server configuration: ADR Preallocation Factor](../database-engine/configure-windows/adr-preallocation-factor-server-configuration-option.md).
177
+
- For [!INCLUDE[ssNoVersion](../includes/ssnoversion-md.md)], when tiered performance storage is available, consider placing the PVS filegroup on higher tier storage. For more information, see [Change the PVS filegroup](accelerated-database-recovery-management.md#change-the-pvs-filegroup).
180
178
181
179
- For [!INCLUDE[sssql22-md](../includes/sssql22-md.md)] and later, consider enabling multi-threaded PVS cleanup if the single-threaded cleaner performance is insufficient. For more information, see [Server configuration: ADR Cleaner Thread Count](../database-engine/configure-windows/adr-cleaner-thread-count-configuration-option.md).
@@ -25,11 +25,11 @@ This article teaches you to enable and disable [accelerated database recovery (A
25
25
26
26
## Who should consider accelerated database recovery
27
27
28
-
Many customers find accelerated database recovery (ADR) a valuable technology to improve database recovery time.
28
+
Many customers find accelerated database recovery (ADR) a valuable technology to improve database recovery time and avoid lengthy rollbacks.
29
29
30
-
If your database workloads frequently encounter the following scenarios, you might benefit from ADR:
30
+
If your database workloads frequently encounter the following scenarios, you can benefit from ADR:
31
31
32
-
- Long running transactions that can't be avoided. For example, in cases where long-running transactions are at risk of being rolled back, ADR can help.
32
+
- Long running transactions that can't be avoided. For example, ADR helps in cases where long-running transactions are at risk of being rolled back.
33
33
- Active transactions that cause the transaction log to grow significantly.
34
34
- Long-running database recovery that impacts the availability of the database (for example, after an unexpected SQL Server restart or manual transaction rollback).
0 commit comments