Skip to content

Commit df7bffc

Browse files
authored
Merge pull request #4420 from ShawnJackson/restore-and-recovery-of-memory-optimized-tables
edit pass: restore-and-recovery-of-memory-optimized-tables
2 parents 6791cf6 + f48d89e commit df7bffc

1 file changed

Lines changed: 27 additions & 23 deletions

File tree

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Restore and Recovery of Memory-Optimized Tables | Microsoft Docs"
2+
title: "Restore and recovery of memory-optimized tables | Microsoft Docs"
33
ms.custom: ""
44
ms.date: "12/31/2017"
55
ms.prod: "sql-non-specified"
@@ -19,52 +19,56 @@ ms.author: "jhubbard"
1919
manager: "jhubbard"
2020
ms.workload: "Inactive"
2121
---
22-
# Restore and Recovery of Memory-Optimized Tables
22+
# Restore and recovery of memory-optimized tables
2323
[!INCLUDE[appliesto-ss-xxxx-xxxx-xxx-md](../../includes/appliesto-ss-xxxx-xxxx-xxx-md.md)]
2424

25-
The basic mechanism to recover or restore a database with memory-optimized tables is similar to databases with only disk-based tables. But unlike disk-based tables, memory-optimized tables must be loaded into memory before database is available for user access. This adds a new step in the database recovery.
25+
The basic mechanism to recover or restore a database that uses memory-optimized tables is similar to the mechanism for a database that uses only disk-based tables. But unlike disk-based tables, memory-optimized tables must be loaded into memory before the database is available for user access. This requirement adds a new step in the database recovery.
2626

27-
If the server does not have enough available memory, database recovery will fail and the database will be marked as suspect. To resolve this issue, see [Resolve Out Of Memory issues](resolve-out-of-memory-issues.md).
27+
If the server does not have enough available memory, database recovery fails and the database is marked as suspect. To resolve this problem, see [Resolve out-of-memory issues](resolve-out-of-memory-issues.md).
2828

29-
During recovery or restore operations, the In-Memory OLTP engine reads data and delta files for loading into physical memory. The load time is determined by:
29+
## Factors that affect load time
30+
During recovery or restore operations, the In-Memory OLTP engine reads data and delta files for loading into physical memory. The load time is determined by:
3031

3132
- The amount of data to load.
3233

3334
- Sequential I/O bandwidth.
3435

35-
- Degree of parallelism, determined by number of file containers and processor cores.
36+
- The degree of parallelism, determined by the number of file containers and processor cores.
3637

37-
- The amount of log records in the active portion of the log that need to be redone.
38-
39-
When the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] restarts, each database goes through a recovery phase that consists of the following three phases:
38+
- The number of log records in the active portion of the log that need to be redone.
39+
40+
## Phases of recovery
41+
When [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] restarts, each database goes through a recovery process that consists of three phases:
4042

41-
1. The analysis phase. During this phase, a pass is made on the active transaction logs to detect committed and uncommitted transactions. The In-Memory OLTP engine identifies the checkpoint to load and preloads its system table log entries. It will also process some file allocation log records.
43+
1. **Analysis**. In this phase, a pass is made on the active transaction logs to detect committed and uncommitted transactions. The In-Memory OLTP engine identifies the checkpoint to load and preloads its system table log entries. It also processes some file allocation log records.
4244

43-
2. The redo phase. This phase is run concurrently on both disk-based and memory-optimized tables.
45+
2. **Redo**. This phase is run concurrently on both disk-based and memory-optimized tables.
4446

45-
For disk-based tables, the database is moved to the current point in time and acquires locks taken by uncommitted transactions.
47+
- For disk-based tables, the database is moved to the current point in time and acquires locks taken by uncommitted transactions.
4648

47-
For memory-optimized tables, data from the data and delta file pairs are loaded into memory and then update the data with the active transaction log based on the last durable checkpoint.
49+
- For memory-optimized tables, data from the data and delta file pairs are loaded into memory. Data is then updated with the active transaction log based on the last durable checkpoint.
4850

49-
When the above operations on disk-based and memory-optimized tables are complete, the database is available for access.
51+
When the preceding operations on disk-based and memory-optimized tables are complete, the database is available for access.
5052

51-
3. The undo phase. In this phase, the uncommitted transactions are rolled back.
53+
3. **Undo**. In this phase, the uncommitted transactions are rolled back.
5254

53-
Loading memory-optimized tables into memory can affect performance of the recovery time objective (RTO). To improve the load time of memory-optimized data from data and delta files, the In-Memory OLTP engine loads the data/delta files in parallel as follows:
55+
## Process for improving load time
56+
Loading memory-optimized tables into memory can affect performance of the recovery time objective (RTO). To improve the load time of memory-optimized data from data and delta files, the In-Memory OLTP engine loads the data/delta files in parallel as follows:
5457

55-
- Creating a Delta Map Filter. Delta files store references to the deleted rows. One thread per container reads the delta files and creates a delta map filter. (A memory optimized data filegroup can have one or more containers.)
58+
- **Creating a delta map filter**. Delta files store references to the deleted rows. One thread per container reads the delta files and creates a delta map filter. (A memory-optimized data file group can have one or more containers.)
5659

57-
- Streaming the data files. Once the delta-map filter is created, data files are read using as many threads as there are logical CPUs. Each thread reading the data file reads the data rows, checks the associated delta map and only inserts the row into table if this row has not been marked deleted. This part of recovery can be CPU bound in some cases as noted below.
60+
- **Streaming the data files**. After the delta map filter is created, data files are read by as many threads as there are logical CPUs. Each thread reads the data rows, checks the associated delta map, and inserts a row into the table only if the row has not been marked deleted. This part of recovery can be CPU bound in some cases, as noted in this diagram:
5861

59-
![Memory-optimized tables.](../../relational-databases/in-memory-oltp/media/memory-optimized-tables.gif "Memory-optimized tables.")
62+
![Data streaming to memory-optimized tables](../../relational-databases/in-memory-oltp/media/memory-optimized-tables.gif "Data streaming to memory-optimized tables")
6063

61-
Memory-optimized tables can generally be loaded into memory at the speed of I/O but there are cases when loading data rows into memory will be slower. Specific cases are:
64+
## Specific cases of slow load times
65+
Memory-optimized tables can generally be loaded into memory at the speed of I/O, but loading data rows into memory is sometimes slower. Specific cases are:
6266

63-
- Low bucket count for hash index can lead to excessive collision causing data row inserts to be slower. This generally results in very high CPU utilization throughout, and especially towards the end of recovery. If you configured the hash index correctly, it should not impact the recovery time.
67+
- Low bucket count for a hash index can lead to excessive collision, which causes data row inserts to be slower. This generally results in high CPU utilization throughout, and especially toward the end of recovery. If you configured the hash index correctly, it should not affect the recovery time.
6468

65-
- Large memory-optimized tables with one or more nonclustered indexes, unlike a hash index whose bucket count is sized at create time, the nonclustered indexes grow dynamically, resulting in high CPU utilization.
69+
- Large memory-optimized tables with one or more nonclustered indexes can cause high CPU utilization. Unlike a hash index whose bucket count is sized at create time, nonclustered indexes grow dynamically.
6670

67-
## See Also
71+
## See also
6872
[Backup, Restore, and Recovery of Memory-Optimized Tables](http://msdn.microsoft.com/library/3f083347-0fbb-4b19-a6fb-1818d545e281)
6973

7074

0 commit comments

Comments
 (0)