.alter materialized view cache policy

Change the materialized view cache policy. To speed up queries on data, Azure Data Explorer caches it on its processing nodes, SSD, or even in RAM. The cache policy lets Azure Data Explorer describe the data artifacts that it uses so that important data can take priority.

Syntax

.alter materialized view MaterializedViewName policy caching PolicyParameter

Arguments

MaterializedViewName - Specify the name of the materialized view. PolicyParameter - Define one or more policy parameters. For parameters, see cache policy.

Example

Set the caching policy to include the last 30 days.

.alter materialized-view MyMaterializedView policy caching hot = 30d

Set the caching policy to include the last 30 days and data from January and April 2021.

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