Change data policies

In this article, you learn how to change the Data retention policy and the Caching policy in your KQL database.

Prerequisites

Data retention policy

The retention policy controls the mechanism that automatically removes data from tables or materialized views. It's useful to remove data that continuously flows into a table, and whose relevance is age-based. For example, the policy can be used for a table that holds diagnostics events that might become uninteresting after two weeks. The default data retention policy is 3,650 days, with a maximum of 36,500 days.

For more information, see Retention policy.

  1. To change the data retention policy, browse to your KQL database and select Manage > Data policies.

    Screenshot showing the manage tab in a KQL database.

  2. Under Retention, either select the toggle to set the retention period to Unlimited, or enter a time period and select Done. By default, your data is stored for 3650 days.

    Screenshot of data retention policy pane with default value.

    Note

    The minimum retention period is 1 day. The maximum retention period is 36,500 days.

Caching policy

The caching policy allows you to choose which data should be cached and kept in local SSD storage. The availability of data in hot cache increases query performance but also storage costs. In Real-Time Intelligence, you can enable a caching policy on KQL Databases. After enabling caching, you can set the time span that the data remains in the hot cache.

For more information, see Caching policy.

  1. To change the caching policy, browse to your KQL database and select Manage > Data policies.

    Screenshot showing the manage tab in a KQL database.

  2. Under Caching, either select the toggle to set the caching period to Unlimited, or enter a time period and select Done. By default, your data is cached for 3650 days.

    Screenshot of caching policy pane with default value.

    Note

    The time period you set for the caching policy must be lower than or equal to the data retention time period.