.alter cluster caching policy command

Changes the cluster's caching policy. To speed up queries, data is cached on processing nodes, SSD, or even in RAM. The caching policy allows your cluster to describe the data artifacts that it uses, so that more important data can take priority.

Permissions

You must have AllDatabasesAdmin permissions to run this command.

Syntax

.alter cluster policy caching PolicyParameter

Learn more about syntax conventions.

Parameters

Name Type Required Description
PolicyParameter string ✔️ One or more policy parameters. For parameters, see caching policy.

Returns

Returns a JSON representation of the policy.

Example

The following example sets the caching policy to include the last 30 days.

.alter cluster policy caching hot = 30d

Output

PolicyName EntityName Policy ChildEntities EntityType
CachingPolicy {"DataHotSpan": { "Value": "30.00:00:00" }, "IndexHotSpan": { "Value": "30.00:00:00"}}

Define hot-cache windows

This command sets the caching policy to include the last 30 days and additional data from January and April 2021.

.alter cluster policy caching 
        hot = 30d,
        hot_window = datetime(2021-01-01) .. datetime(2021-02-01),
        hot_window = datetime(2021-04-01) .. datetime(2021-05-01)

Output

PolicyName EntityName Policy ChildEntities EntityType
CachingPolicy {"DataHotSpan": { "Value": "30.00:00:00" }, "IndexHotSpan": { "Value": "30.00:00:00" },"HotWindows": [{ "MinValue": "2021-01-01T00:00:00Z", "MaxValue": "2021-02-01T00:00:00Z" }, { "MinValue": "2021-04-01T00:00:00Z", "MaxValue": "2021-05-01T00:00:00Z" }]}