At its core, Accelerated Database Recovery is a revolutionary SQL Server feature that dramatically boosts database availability. It’s a game-changer in situations where long-running transactions are involved, as it entirely overhauls the SQL database engine recovery process. ADR’s core benefits include swift and consistent database recovery, immediate transaction rollback, and aggressive log truncation.
The New and Improved ADR in SQL Server 2022
SQL Server 2022 introduces several improvements to ADR, specifically designed to tackle persistent version store (PVS) storage challenges and enhance overall scalability.
User Transaction Cleanup: A More Efficient Approach
ADR’s cleanup process in SQL Server 2022 has been enhanced by enabling user transactions to clean up pages that the regular process could not handle due to conflicts at the table level lock. This ensures the ADR cleanup process no longer becomes indefinitely stalled due to lock acquisition issues, thereby increasing the overall effectiveness and efficiency of the system.
A Leaner Memory Footprint for PVS Page Tracker
SQL Server 2022 employs a clever strategy to decrease the memory footprint required to maintain versioned pages. It achieves this by tracking persisted version store (PVS) pages at the extent level, an optimization that facilitates more efficient management of the SQL Server instance’s memory resources. The ADR cleaner process has been redefined to enhance version cleanup efficiencies. SQL Server 2022 has refined how it tracks and records aborted versions of a page, which significantly improves memory and capacity.
Transaction-level Persisted Version Store (PVS): Bridging the Gap
This new feature empowers ADR to clean up versions linked to committed transactions, regardless of whether the system has aborted transactions. The result is that PVS pages can be deallocated even if the cleanup doesn’t complete a successful sweep. This reduces PVS growth even if ADR cleanup is delayed or fails.
Multi-threaded Version Cleanup: Power in Numbers
SQL Server 2022 has introduced multi-threaded version cleanup, which allows several databases in the same SQL Server instance to be cleaned simultaneously. This enhancement is particularly beneficial when dealing with multiple large databases. The number of threads used for version cleanup can be adjusted for scalability with sp_configure
.
EXEC sp_configure 'ADR Cleaner Thread Count', '8' RECONFIGURE WITH OVERRIDE;
In Conclusion
The enhancements in Accelerated Database Recovery in SQL Server 2022 offer substantial benefits for database administrators and developers. They improve the speed and efficiency of database recovery processes, reduce the memory footprint, and enhance cleanup efficiencies. As SQL Server continues to evolve, we can anticipate further enhancements to ADR and other features that will continue to refine database performance, recovery, and management. You can watch my YouTube videos over here.
Reference: Pinal Dave (https://blog.sqlauthority.com)
First appeared on The Evolution of Accelerated Database Recovery in SQL Server 2022