From d66a2ba4fb820036f86fb8292bd49362ee349184 Mon Sep 17 00:00:00 2001 From: Ravi Tella Date: Mon, 13 Sep 2021 11:01:28 -0400 Subject: [PATCH] added a comment on query plan caching. --- sdk/cosmos/azure-spring-data-cosmos/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sdk/cosmos/azure-spring-data-cosmos/README.md b/sdk/cosmos/azure-spring-data-cosmos/README.md index ffb66e2c04de..e90871822749 100644 --- a/sdk/cosmos/azure-spring-data-cosmos/README.md +++ b/sdk/cosmos/azure-spring-data-cosmos/README.md @@ -294,6 +294,9 @@ public interface UserRepository extends CosmosRepository { - `findByFirstName` method is custom query method, it will find items per firstName. +#### Query Plan Caching +When query plan caching is enabled, custom query methods like `findByFirstName(String firstName)` where `firstName` is the partition key will result in lower query execution time. Query plan caching can be enabled by setting the `COSMOS.QUERYPLAN_CACHING_ENABLED` System property to 'true'. Currently, query plan caching is only supported for custom query methods targeting a single partition. + #### QueryAnnotation : Using annotated queries in repositories Azure spring data cosmos supports specifying annotated queries in the repositories using `@Query`. - Examples for annotated queries in synchronous CosmosRepository: