Skip to content

Commit 1de7562

Browse files
authored
Merge pull request #7055 from spelluru/adxhotwindows
Set hot windows in an include file
2 parents d7a498d + 8aadc9e commit 1de7562

File tree

2 files changed

+52
-46
lines changed

2 files changed

+52
-46
lines changed

data-explorer/hot-windows.md

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -39,52 +39,7 @@ After changing the cache policy, the cluster automatically caches the relevant d
3939

4040
Now you can expect optimal performance during the use of hot windows.
4141

42-
## Set hot windows
43-
44-
Hot windows are part of the [cache policy commands syntax](/kusto/management/show-table-cache-policy-command?view=azure-data-explorer&preserve-view=true) and are set with the [`.alter policy caching` command](/kusto/management/cache-policy?view=azure-data-explorer&preserve-view=true).
45-
46-
> [!NOTE]
47-
> It can take up to an hour to fully update the cluster disk cache based on the updated cache policy definition.
48-
49-
1. Take note of the initial caching policy by using the `.show policy caching` command.
50-
51-
```kusto
52-
.show table MyDatabase.MyTable policy caching
53-
```
54-
55-
1. Alter the cache policy using the following syntax. Several hot windows may be defined for a single database or table.
56-
57-
```kusto
58-
.alter <entity_type> <database_or_table_or_materialized-view_name> policy caching
59-
hot = <timespan>
60-
[, hot_window = datetime(*from*) .. datetime(*to*)]
61-
[, hot_window = datetime(*from*) .. datetime(*to*)]
62-
...
63-
```
64-
65-
Where:
66-
* `from`: Start time of the hot window (datetime)
67-
* `to`: End time of the hot window (datetime)
68-
69-
For example, queries run under the following settings will examine the last 14 days of data, on data that is kept for three years.
70-
71-
```kusto
72-
.alter table MyTable policy caching
73-
hot = 14d,
74-
hot_window = datetime(2021-01-01) .. datetime(2021-02-01),
75-
hot_window = datetime(2021-04-01) .. datetime(2021-05-01)
76-
```
77-
78-
## Run query
79-
80-
Run the query or queries you want over the time period specified in the hot windows.
81-
82-
## Revert settings
83-
84-
1. Use the original cache settings retrieved above in [Set hot windows](#set-hot-windows).
85-
1. Revert the cache policy to the original settings with the [`.alter policy caching` command](/kusto/management/show-table-cache-policy-command?view=azure-data-explorer&preserve-view=true).
86-
87-
Since you've configured optimized autoscale for that cluster, the cluster will shrink to its original size.
42+
[!INCLUDE [set-hot-windows](includes/cross-repo/set-hot-windows.md)]
8843

8944
## Related content
9045

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
ms.topic: include
3+
ms.date: 07/02/2023
4+
---
5+
6+
## Set hot windows
7+
8+
Hot windows are part of the [cache policy commands syntax](/kusto/management/show-table-cache-policy-command?view=azure-data-explorer&preserve-view=true) and are set with the [`.alter policy caching` command](/kusto/management/cache-policy?view=azure-data-explorer&preserve-view=true).
9+
10+
> [!NOTE]
11+
> It can take up to an hour to fully update the cluster disk cache based on the updated cache policy definition.
12+
13+
1. Take note of the initial caching policy by using the `.show policy caching` command.
14+
15+
```kusto
16+
.show table MyDatabase.MyTable policy caching
17+
```
18+
19+
1. Alter the cache policy using the following syntax. Several hot windows may be defined for a single database or table.
20+
21+
```kusto
22+
.alter <entity_type> <database_or_table_or_materialized-view_name> policy caching
23+
hot = <timespan>
24+
[, hot_window = datetime(*from*) .. datetime(*to*)]
25+
[, hot_window = datetime(*from*) .. datetime(*to*)]
26+
...
27+
```
28+
29+
Where:
30+
* `from`: Start time of the hot window (datetime)
31+
* `to`: End time of the hot window (datetime)
32+
33+
For example, queries run under the following settings will examine the last 14 days of data, on data that is kept for three years.
34+
35+
```kusto
36+
.alter table MyTable policy caching
37+
hot = 14d,
38+
hot_window = datetime(2021-01-01) .. datetime(2021-02-01),
39+
hot_window = datetime(2021-04-01) .. datetime(2021-05-01)
40+
```
41+
42+
## Run query
43+
44+
Run the query or queries you want over the time period specified in the hot windows.
45+
46+
## Revert settings
47+
48+
1. Use the original cache settings retrieved above in [Set hot windows](#set-hot-windows).
49+
1. Revert the cache policy to the original settings with the [`.alter policy caching` command](/kusto/management/show-table-cache-policy-command?view=azure-data-explorer&preserve-view=true).
50+
51+
Since you've configured optimized autoscale for that cluster, the cluster will shrink to its original size.

0 commit comments

Comments
 (0)