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/custom-partitioning-analytical-store.md
+49-10Lines changed: 49 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,13 +20,11 @@ In this article, you will learn how to partition your data in Azure Cosmos DB an
20
20
> Custom partitioning feature is currently in public preview. This preview version is provided without a service level agreement, and it's not recommended for production workloads. Certain features might not be supported or might have constrained capabilities. For more information, see [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/).
21
21
22
22
> [!NOTE]
23
-
> Azure Cosmos DB accounts should have Azure Synapse Link(synapse-link.md) enabled to take advantage of custom partitioning. Custom partitioning is currently supported for Azure Synapse Spark 2.0 only.
23
+
> Azure Cosmos DB accounts should have [Azure Synapse Link](synapse-link.md) enabled to take advantage of custom partitioning. Custom partitioning is currently supported for Azure Synapse Spark 2.0 only.
24
24
25
25
## How does it work?
26
26
27
-
Analytical store partitioning is independent of partitioning in the transactional store. By default, analytical store is not partitioned. If you want to query analytical store frequently based on fields such as Date, Time, Category etc. you may benefit from creating a partitioned store based on these keys.
28
-
29
-
With custom partitioning, you can choose a single field or a combination of fields from your dataset as the analytical store partition key.
27
+
Analytical store partitioning is independent of partitioning in the transactional store. By default, analytical store is not partitioned. If you want to query analytical store frequently based on fields such as Date, Time, Category etc. you leverage custom partitioning to create a separate partitioned store based on these keys. You can choose a single field or a combination of fields from your dataset as the analytical store partition key.
30
28
31
29
You can trigger partitioning from an Azure Synapse Spark notebook using Azure Synapse Link. You can schedule it to run as a background job, once or twice a day but can be executed more often, if needed.
32
30
@@ -76,7 +74,49 @@ If you configured [managed private endpoints](analytical-store-private-endpoints
76
74
77
75
Similarly, if you configured [customer-managed keys on analytical store](how-to-setup-cmk.md#is-it-possible-to-use-customer-managed-keys-in-conjunction-with-the-azure-cosmos-db-analytical-store), you must directly enable it on the Synapse workspace primary storage account, which is the partitioned store, as well.
78
76
79
-
77
+
## Partitioning strategies
78
+
You could use one or more partition keys for your analytical data. If you are using multiple partiton keys, below are some recommendations on how to partition the data:
79
+
-**Using composite keys:**
80
+
81
+
Say, you want to frequently query based on Key1 and Key2.
82
+
83
+
For example, "Query for all records where ReadDate = ‘2021-10-08’ and Location = ‘Sydney’".
84
+
85
+
In this case, using composite keys will be more efficient, to look up all records that match the ReadDate and the records that match Location within that ReadDate.
Please note that it's not efficient to now frequently query based on "ReadDate" and "Location" filters together, on above partitioning. Composite keys will give
118
+
better query performance in that case.
119
+
80
120
## Limitations
81
121
82
122
* Custom partitioning is only available for Azure Synapse Spark. Custom partitioning is currently not supported for serverless SQL pools.
@@ -116,13 +156,12 @@ Yes, the partition key for the given container can be changed and the new partit
116
156
117
157
### Can different partition keys point to the same BasePath?
118
158
119
-
Yes, since the partition key definition is part of the partitioned store path, different partition keys will have different paths branching from the same BasePath.
159
+
Yes, you can specify multiple partition keys on the same partitioned store as below:
120
160
121
-
Base path format could be specified as: /mnt/partitionedstorename/\<Cosmos_DB_account_name\>/\<Cosmos_DB_database_rid\>/\<Cosmos_DB_container_rid\>/partition=partitionkey/
0 commit comments