Skip to content

Commit f865b0e

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

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 that target a prefix of the hierarchical partition key path, you should include those leading partition key values in the **WHERE** clause so the query can be routed efficiently. Supplying values only via `PartitionKeyBuilder` doesn't by itself guarantee efficient routing. Queries that omit partition key values from 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)