Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: .alter query acceleration policy command
description: Learn how to use the .alter query acceleration policy command to accelerate queries over external delta tables.
ms.reviewer: sharmaanshul
ms.topic: reference
ms.date: 09/16/2025
ms.date: 11/30/2025
---

# `.alter query acceleration policy` command
Expand All @@ -30,17 +30,21 @@ You must have at least [Database Admin](../access-control/role-based-access-cont
| _JSON-serialized policy_ | `string` | :heavy_check_mark: | String literal holding a [JSON property bag](#json-property-bag). |

### JSON property bag

::: moniker range="microsoft-fabric"

| Property | Type | Required | Description |
| ------------------- | ---------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| IsEnabled | `Boolean` | :heavy_check_mark: | Indicates whether the policy is enabled. |
| Hot | `Timespan` | :heavy_check_mark: | The hot period defined in the query acceleration policy. Minimum value = 1 d. |
| HotWindows | `DateTime` | | One or more optional time windows. Delta data files created within these time windows are accelerated. |
| MaxAge | `Timespan` | | The external table returns accelerated data if the last index refresh time is greater than @now - MaxAge. Otherwise, the external table operates in non-accelerated mode. Default is 5 minutes. Minimum is 1 minute. This property can also be overridden at query time by using the [`external_table()` function's](../query/external-table-function.md) `MaxAgeOverride` parameter. |
| HotDateTimeColumn | `String` | | Optional. The name of a datetime column in the Delta table whose values will be used to determine hot-cache eligibility. When set, data files whose rows have values within the configured Hot period (and/or HotWindows) are selected for caching. |

::: moniker-end

::: moniker range="azure-data-explorer"

| Property | Type | Required | Description |
| ------------------- | ---------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| IsEnabled | `Boolean` | :heavy_check_mark: | Indicates whether the policy is enabled. |
Expand All @@ -49,9 +53,12 @@ You must have at least [Database Admin](../access-control/role-based-access-cont
| MaxAge | `Timespan` | | The external table returns accelerated data if the last index refresh time is greater than @now - MaxAge. Otherwise, the external table operates in non-accelerated mode. Default is 5 minutes. Minimum is 1 minute. This property can also be overridden at query time by using the [`external_table()` function's](../query/external-table-function.md) `MaxAgeOverride` parameter. |
| ManagedIdentity | `string` | | Optional managed identity for which the query acceleration background operations are executed. This identity must have relevant delta table permissions and must be enabled for AutomatedFlows in the cluster / database managed identity policy. For more information, see [Managed identities overview](/azure/data-explorer/managed-identities-overview). |
| HotDateTimeColumn | `String` | | Optional. The name of a datetime column in the Delta table whose values will be used to determine hot-cache eligibility. When set, data files whose rows have values within the configured Hot period (and/or HotWindows) are selected for caching. |

::: moniker-end

> [!NOTE]
> Query acceleration is applied to data within a specific time period, defined as `timespan`, starting from the `modificationTime` as stated for each file in the [delta log](https://github.com/delta-io/delta/blob/master/PROTOCOL.md#add-file-and-remove-file).
>
> Query acceleration is applied to data within a specific time period, based on the `modificationTime` as stated for each file in the [delta log](https://github.com/delta-io/delta/blob/master/PROTOCOL.md#add-file-and-remove-file) by default. You can override the default behavior, by specifying the _HotDateTimeColumn_ property in the policy.

### Example

Expand All @@ -72,17 +79,23 @@ The command returns a table with one record that includes the modified policy ob
| EntityType | `string` | The type of the entity the policy applies to - `ExternalTable` |

## Example

::: moniker range="microsoft-fabric"

```Kusto
.alter external table MyExternalTable policy query_acceleration '{"IsEnabled": true, "Hot": "1.00:00:00", "HotWindows":[{"MinValue":"2025-07-07 07:00:00","MaxValue":"2025-07-09 07:00:00"}], "MaxAge": "00:05:00", "HotDateTimeColumn":"dt1"}'
```

::: moniker-end

::: moniker range="azure-data-explorer"

```Kusto
.alter external table MyExternalTable policy query_acceleration '{"IsEnabled": true, "Hot": "1.00:00:00", "HotWindows":[{"MinValue":"2025-07-07 07:00:00","MaxValue":"2025-07-09 07:00:00"}], "MaxAge": "00:05:00", "ManagedIdentity": "12345678-1234-1234-1234-1234567890ab", "HotDateTimeColumn":"dt1"}'
```

::: moniker-end

## Related content

- [Query acceleration policy](query-acceleration-policy.md)
Expand Down