Skip to content

Latest commit

 

History

History
51 lines (40 loc) · 2.5 KB

query-consistency-policy.md

File metadata and controls

51 lines (40 loc) · 2.5 KB
title description ms.reviewer ms.topic ms.date
Query consistency policy
Learn how to use the query consistency policy to control the consistency mode of queries.
yonil
reference
11/27/2023

Query consistency policy

A workload group's query consistency policy allows specifying options that control the consistency mode of queries.

The policy object

Each option consists of:

  • A typed Value - the value of the limit.
  • IsRelaxable - a boolean value that defines if the option can be relaxed by the caller, as part of the request's request properties. Default is true.

The following limits are configurable:

Name Type Description Supported values Default value Matching client request property
QueryConsistency QueryConsistency The consistency mode to use. Strong, Weak, or WeakAffinitizedByQuery, WeakAffinitizedByDatabase Strong queryconsistency
CachedResultsMaxAge timespan The maximum age of cached query results that can be returned. A non-negative timespan null query_results_cache_max_age

Note

The default value applies in the following cases:

  • The policy isn't defined, and the client request option isn't set.
  • The policy is defined, the option isn't defined, and the client request option isn't set.
  • The policy is defined, the option is defined with null as its Value, and the client request option isn't set.

Example

"QueryConsistencyPolicy": {
  "QueryConsistency": {
    "IsRelaxable": true,
    "Value": "Weak"
  },
  "CachedResultsMaxAge": {
    "IsRelaxable": true,
    "Value": "05:00:00"
  }
}

Related content