Skip to content

Commit 4ee280b

Browse files
committed
Fix issue 7013
1 parent 9511a5a commit 4ee280b

2 files changed

Lines changed: 77 additions & 77 deletions

File tree

docs/includes/sql-b-tree.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
author: MikeRayMSFT
33
ms.author: mikeray
4-
ms.date: 01/26/2022
4+
ms.reviewer: randolphwest
5+
ms.date: 05/09/2023
56
ms.service: sql
67
ms.topic: include
78
---
8-
9-
> [!NOTE]
10-
> SQL Server documentation uses the term B-tree generally in reference to indexes. In rowstore indexes, SQL Server implements a B+ tree. This does not apply to columnstore indexes or in-memory data stores. Review [SQL Server Index Architecture and Design Guide](../relational-databases/sql-server-index-design-guide.md) for details.
9+
> [!NOTE]
10+
> SQL Server documentation uses the term B-tree generally in reference to indexes. In rowstore indexes, SQL Server implements a B+ tree. This does not apply to columnstore indexes or in-memory data stores. For more information, see the [SQL Server and Azure SQL index architecture and design guide](../relational-databases/sql-server-index-design-guide.md).
Lines changed: 73 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,73 @@
1-
---
2-
title: "Prerequisites for Minimal Logging in Bulk Import"
3-
description: In a simple recovery or bulk-logged recovery model, minimal logging of bulk-import operations reduces the possibility that an operation fills the log space.
4-
author: rwestMSFT
5-
ms.author: randolphwest
6-
ms.date: "03/17/2017"
7-
ms.service: sql
8-
ms.subservice: data-movement
9-
ms.topic: conceptual
10-
helpviewer_keywords:
11-
- "minimal logging [SQL Server]"
12-
- "logged bulk copy [SQL Server]"
13-
- "logs [SQL Server], minimal logging"
14-
- "minimally logged operations [SQL Server]"
15-
- "bulk importing [SQL Server], minimal logging"
16-
---
17-
# Prerequisites for Minimal Logging in Bulk Import
18-
[!INCLUDE [SQL Server](../../includes/applies-to-version/sqlserver.md)]
19-
20-
For a database under the full recovery model, all row-insert operations that are performed by bulk import are fully logged in the transaction log. Large data imports can cause the transaction log to fill rapidly if the full recovery model is used. In contrast, under the simple recovery model or bulk-logged recovery model, minimal logging of bulk-import operations reduces the possibility that a bulk-import operation will fill the log space. Minimal logging is also more efficient than full logging.
21-
22-
> [!NOTE]
23-
> The bulk-logged recovery model is designed to temporarily replace the full recovery model during large bulk operations.
24-
25-
## Table Requirements for Minimally Logging Bulk-Import Operations
26-
Minimal logging requires that the target table meets the following conditions:
27-
28-
- The table is not being replicated.
29-
30-
- Table locking is specified (using TABLOCK).
31-
32-
> [!NOTE]
33-
> Although data insertions are not logged in the transaction log during a minimally logged bulk-import operation, the [!INCLUDE[ssDE](../../includes/ssde-md.md)] still logs extent allocations each time a new extent is allocated to the table.
34-
35-
- Table is not a memory-optimized table.
36-
37-
Whether minimal logging can occur for a table also depends on whether the table is indexed and, if so, whether the table is empty:
38-
39-
- If the table has no indexes, data pages are minimally logged.
40-
41-
- If the table has no clustered index but has one or more nonclustered indexes, data pages are always minimally logged. How index pages are logged, however, depends on whether the table is empty:
42-
43-
- If the table is empty, index pages are minimally logged. If you start with an empty table and bulk import the data in multiple batches, both index and data pages are minimally logged for the first batch, but beginning with the second batch, only data pages are minimally logged.
44-
45-
- If table is non-empty, index pages are fully logged.
46-
47-
- If the table has a clustered index and is empty, both data and index pages are minimally logged. In contrast, if a table has a B-tree based clustered index and is non-empty, data pages and index pages are both fully logged regardless of the recovery model. If you start with an empty table rowstore table and bulk import the data in batches, both index and data pages are minimally logged for the first batch, but from the second batch onwards, only data pages are bulk logged.
48-
49-
[!INCLUDE [sql-b-tree](../../includes/sql-b-tree.md)]
50-
51-
- For information about logging for a clustered columnstore index (CCI), see [Columnstore index data loading guidance](../indexes/columnstore-indexes-data-loading-guidance.md#plan-bulk-load-sizes-to-minimize-delta-rowgroups).
52-
53-
54-
55-
> [!NOTE]
56-
> When transactional replication is enabled, BULK INSERT operations are fully logged even under the Bulk Logged recovery model.
57-
58-
## <a name="RelatedTasks"></a> Related Tasks
59-
60-
- [View or Change the Recovery Model of a Database &#40;SQL Server&#41;](../../relational-databases/backup-restore/view-or-change-the-recovery-model-of-a-database-sql-server.md)
61-
62-
63-
## See Also
64-
[Recovery Models &#40;SQL Server&#41;](../../relational-databases/backup-restore/recovery-models-sql-server.md)
65-
[bcp Utility](../../tools/bcp-utility.md)
66-
[BULK INSERT &#40;Transact-SQL&#41;](../../t-sql/statements/bulk-insert-transact-sql.md)
67-
[OPENROWSET &#40;Transact-SQL&#41;](../../t-sql/functions/openrowset-transact-sql.md)
68-
[BACKUP &#40;Transact-SQL&#41;](../../t-sql/statements/backup-transact-sql.md)
69-
[ALTER DATABASE &#40;Transact-SQL&#41;](../../t-sql/statements/alter-database-transact-sql.md)
70-
[Table Hints &#40;Transact-SQL&#41;](../../t-sql/queries/hints-transact-sql-table.md)
71-
[INSERT &#40;Transact-SQL&#41;](../../t-sql/statements/insert-transact-sql.md)
72-
73-
1+
---
2+
title: Prerequisites for minimal logging in bulk import
3+
description: In a simple recovery or bulk-logged recovery model, minimal logging of bulk-import operations reduces the possibility that an operation fills the log space.
4+
author: rwestMSFT
5+
ms.author: randolphwest
6+
ms.date: 05/09/2023
7+
ms.service: sql
8+
ms.subservice: data-movement
9+
ms.topic: conceptual
10+
helpviewer_keywords:
11+
- "minimal logging [SQL Server]"
12+
- "logged bulk copy [SQL Server]"
13+
- "logs [SQL Server], minimal logging"
14+
- "minimally logged operations [SQL Server]"
15+
- "bulk importing [SQL Server], minimal logging"
16+
---
17+
# Prerequisites for minimal logging in bulk import
18+
19+
[!INCLUDE [SQL Server](../../includes/applies-to-version/sqlserver.md)]
20+
21+
For a database under the full recovery model, all row-insert operations that are performed by bulk import are fully logged in the transaction log. Large data imports can cause the transaction log to fill rapidly if the full recovery model is used. In contrast, under the simple recovery model or bulk-logged recovery model, minimal logging of bulk-import operations reduces the possibility that a bulk-import operation fills the log space. Minimal logging is also more efficient than full logging.
22+
23+
> [!NOTE]
24+
> The bulk-logged recovery model is designed to temporarily replace the full recovery model during large bulk operations.
25+
26+
## Table requirements for minimally logging bulk-import operations
27+
28+
Minimal logging requires that the target table meets the following conditions:
29+
30+
- The table isn't being replicated.
31+
32+
- Table locking is specified (using TABLOCK).
33+
34+
> [!NOTE]
35+
> Although data insertions are not logged in the transaction log during a minimally logged bulk-import operation, the [!INCLUDE[ssDE](../../includes/ssde-md.md)] still logs extent allocations each time a new extent is allocated to the table.
36+
37+
- The table isn't a memory-optimized table.
38+
39+
Whether minimal logging can occur for a table also depends on whether the table is indexed and, if so, whether the table is empty:
40+
41+
- If the table has no indexes, data pages are minimally logged.
42+
43+
- If the table has no clustered index but has one or more nonclustered indexes, data pages are always minimally logged. How index pages are logged, however, depends on whether the table is empty:
44+
45+
- If the table is empty, index pages are minimally logged. If you start with an empty table and bulk import the data in multiple batches, both index and data pages are minimally logged for the first batch, but beginning with the second batch, only data pages are minimally logged.
46+
47+
- If the table is non-empty, index pages are fully logged.
48+
49+
- If one of the indexes has IGNORE_DUP_KEY = ON, index and data pages are fully logged.
50+
51+
- If the table has a clustered index and is empty, both data and index pages are minimally logged. In contrast, if a table has a B-tree based clustered index and is non-empty, data pages and index pages are both fully logged regardless of the recovery model. If you start with an empty rowstore table and bulk import the data in batches, both index and data pages are minimally logged for the first batch, but from the second batch onwards, only data pages are bulk logged.
52+
53+
[!INCLUDE [sql-b-tree](../../includes/sql-b-tree.md)]
54+
55+
- For information about logging for a clustered columnstore index (CCI), see [Columnstore index data loading guidance](../indexes/columnstore-indexes-data-loading-guidance.md#plan-bulk-load-sizes-to-minimize-delta-rowgroups).
56+
57+
> [!NOTE]
58+
> When transactional replication is enabled, BULK INSERT operations are fully logged even under the bulk logged recovery model.
59+
60+
## See also
61+
62+
- [Recovery Models (SQL Server)](../../relational-databases/backup-restore/recovery-models-sql-server.md)
63+
- [bcp Utility](../../tools/bcp-utility.md)
64+
- [BULK INSERT (Transact-SQL)](../../t-sql/statements/bulk-insert-transact-sql.md)
65+
- [OPENROWSET (Transact-SQL)](../../t-sql/functions/openrowset-transact-sql.md)
66+
- [BACKUP (Transact-SQL)](../../t-sql/statements/backup-transact-sql.md)
67+
- [ALTER DATABASE (Transact-SQL)](../../t-sql/statements/alter-database-transact-sql.md)
68+
- [Table Hints (Transact-SQL)](../../t-sql/queries/hints-transact-sql-table.md)
69+
- [INSERT (Transact-SQL)](../../t-sql/statements/insert-transact-sql.md)
70+
71+
## Next steps
72+
73+
- [View or Change the Recovery Model of a Database (SQL Server)](../../relational-databases/backup-restore/view-or-change-the-recovery-model-of-a-database-sql-server.md)

0 commit comments

Comments
 (0)