.alter materialized-view policy caching command
Applies to: ✅ Azure Data Explorer
Changes the materialized view's cache policy. To speed up queries, data is cached on processing nodes, SSD, or even in RAM. The cache policy allows your database to describe the data artifacts that it uses, so that more important data can take priority.
Permissions
You must have at least Table Admin permissions to run this command.
Syntax
.alter
materialized-view
MaterializedViewName policy
caching
PolicyParameters
Learn more about syntax conventions.
Parameters
Name | Type | Required | Description |
---|---|---|---|
MaterializedViewName | string |
✔️ | The name of the materialized view. |
PolicyParameters | string |
✔️ | One or more policy parameters. For parameters, see cache policy. |
Examples
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)