Skip to content

Commit ea7d712

Browse files
committed
Hierarhcical partition keys guidance on Partial PK
1 parent 30c8e98 commit ea7d712

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

articles/cosmos-db/hierarchical-partition-keys.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,8 @@ The SDK code that you use to run a query on a subpartitioned container is identi
565565

566566
When the query specifies all values of the partition keys in the `WHERE` filter or in a prefix of the key hierarchy, the SDK automatically routes the query to the corresponding physical partitions. Queries that provide only the "middle" of the hierarchy are cross-partition queries.
567567

568+
For queries intending to use a partial prefix of the hierarchical partition key path, you must explicitly include the partial prefix in the **WHERE** clause to be efficiently routed. Relying solely on supplying values via `PartitionKeyBuilder` does not currently guarantee efficient query execution. Queries that omit the partition key in the **WHERE** clause might incur significantly higher RU costs.
569+
568570
For example, consider a hierarchical partition key that's composed of `TenantId` > `UserId` > `SessionId`. The components of the query's filter determines if the query is a single-partition query, a targeted cross-partition query, or a fan-out query.
569571

570572
| Query | Routing |

0 commit comments

Comments
 (0)