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
Copy file name to clipboardExpand all lines: articles/cosmos-db/merge.md
+74-29Lines changed: 74 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,14 @@
1
1
---
2
-
title: Merge partitions in Azure Cosmos DB (preview)
3
-
description: Learn more about the merge partitions capability in Azure Cosmos DB
2
+
title: Merge partitions (preview)
3
+
titleSuffix: Azure Cosmos DB
4
+
description: Reduce the number of physical partitions used for your container with the merge capability in Azure Cosmos DB.
5
+
ms.topic: conceptual
4
6
author: seesharprun
5
7
ms.author: sidandrews
8
+
ms.reviewer: dech
6
9
ms.service: cosmos-db
10
+
ms.date: 02/07/2023
7
11
ms.custom: event-tier1-build-2022, ignite-2022
8
-
ms.topic: conceptual
9
-
ms.reviewer: dech
10
-
ms.date: 10/26/2022
11
12
---
12
13
13
14
# Merge partitions in Azure Cosmos DB (preview)
@@ -70,13 +71,15 @@ Based on conditions 1 and 2, our container can potentially benefit from merging
70
71
### Merging physical partitions
71
72
72
73
In PowerShell, when the flag `-WhatIf` is passed in, Azure Cosmos DB will run a simulation and return the expected result of the merge, but won't run the merge itself. When the flag isn't passed in, the merge will execute against the resource. When finished, the command will output the current amount of storage in KB per physical partition post-merge.
74
+
73
75
> [!TIP]
74
76
> Before running a merge, it's recommended to set your provisioned RU/s (either manual RU/s or autoscale max RU/s) as close as possible to your desired steady state RU/s post-merge, to help ensure the system calculates an efficient partition layout.
75
77
76
78
#### [PowerShell](#tab/azure-powershell)
77
79
78
-
```azurepowershell
79
-
// Add the preview extension
80
+
Use [`Install-Module`](/powershell/module/powershellget/install-module) to install the [Az.CosmosDB](/powershell/module/az.cosmosdb/) module with pre-release features enabled.
81
+
82
+
```azurepowershell-interactive
80
83
$parameters = @{
81
84
Name = "Az.CosmosDB"
82
85
AllowPrerelease = $true
@@ -85,8 +88,22 @@ $parameters = @{
85
88
Install-Module @parameters
86
89
```
87
90
88
-
```azurepowershell
89
-
// API for NoSQL
91
+
#### [Azure CLI](#tab/azure-cli)
92
+
93
+
Use [`az extension add`](/cli/azure/extension#az-extension-add) to install the [cosmosdb-preview](https://github.com/azure/azure-cli-extensions/tree/main/src/cosmosdb-preview) Azure CLI extension.
94
+
95
+
```azurecli-interactive
96
+
az extension add \
97
+
--name cosmosdb-preview
98
+
```
99
+
100
+
---
101
+
102
+
#### [API for NoSQL](#tab/nosql/azure-powershell)
103
+
104
+
Use `Invoke-AzCosmosDBSqlContainerMerge` with the `-WhatIf` parameter to preview the merge without actually performing the operation.
105
+
106
+
```azurepowershell-interactive
90
107
$parameters = @{
91
108
ResourceGroupName = "<resource-group-name>"
92
109
AccountName = "<cosmos-account-name>"
@@ -97,36 +114,62 @@ $parameters = @{
97
114
Invoke-AzCosmosDBSqlContainerMerge @parameters
98
115
```
99
116
100
-
```azurepowershell
101
-
// API for MongoDB
117
+
Start the merge by running the same command without the `-WhatIf` parameter.
0 commit comments