Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions data-explorer/kusto/query/best-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Best practices for Kusto Query Language queries
description: This article describes Query best practices.
ms.reviewer: alexans
ms.topic: reference
ms.date: 11/11/2024
ms.date: 06/09/2025
adobe-target: true
---
# Best practices for Kusto Query Language queries
Expand All @@ -24,7 +24,7 @@ Here are several best practices to follow to make your query run faster.
| | Use `in`. | Don't use `in~`. |
| | Use `contains_cs`. | Don't use `contains`. | Using `has`/`has_cs` is preferred to `contains`/`contains_cs`. |
| **Searching text** | Look in a specific column. | Don't use `*`. | `*` does a full text search across all columns. |
| **Extract fields from [dynamic objects](scalar-data-types/dynamic.md) across millions of rows** | Materialize your column at ingestion time if most of your queries extract fields from dynamic objects across millions of rows. | | With this method you only pay once for column extraction. |
| **Extract fields from [dynamic objects](scalar-data-types/dynamic.md) across millions of rows** | Materialize your column at ingestion time if most of your queries extract fields from dynamic objects across millions of rows, using an [Update policy](../management/update-policy.md). | | With this method you only pay once for column extraction. |
| **Lookup for rare keys/values in [dynamic objects](scalar-data-types/dynamic.md)** | Use `MyTable | where DynamicColumn has "Rare value" | where DynamicColumn.SomeKey == "Rare value"`. | Don't use `MyTable | where DynamicColumn.SomeKey == "Rare value"`. | With this method you filter out most records and only do JSON parsing on the remainder. |
| **`let` statement with a value that you use more than once** | Use the [materialize() function](materialize-function.md). | | For more information on how to use `materialize()`, see [materialize()](materialize-function.md). For more information, see [Optimize queries that use named expressions](named-expressions.md).|
| **Apply type conversions on more than one billion records** | Reshape your query to reduce the amount of data fed into the conversion. | Don't convert large amounts of data if it can be avoided. | |
Expand Down Expand Up @@ -55,7 +55,7 @@ reduces the amount of data being processed.
> [!NOTE]
> In the following discussion, it is important to have in mind the concept of **filter selectivity**.
> Selectivity is what percentage of the records get filtered-out when filtering by some predicate.
> A highly-selective predicate means that only a handful of records remain after applying
> A highly selective predicate means that only a handful of records remain after applying
> the predicate, reducing the amount of data that needs to then be processed effectively.

In order of importance:
Expand Down
2 changes: 1 addition & 1 deletion data-explorer/kusto/query/extract-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ If there's no match, or the type conversion fails: `null`.

## Examples

The following example extract the username, email, age from the string. The regular expressions are used to extract the information.
The following example extract the username, email, age from the string. The [regular expression](regex.md) are used to extract the information.

:::moniker range="azure-data-explorer"
> [!div class="nextstepaction"]
Expand Down
6 changes: 3 additions & 3 deletions data-explorer/kusto/query/materialize-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: materialize()
description: Learn how to use the materialize() function to capture the value of a tabular expression for reuse.
ms.reviewer: zivc
ms.topic: reference
ms.date: 08/11/2024
ms.date: 06/09/2025
---
# materialize()

Expand All @@ -28,7 +28,7 @@ Captures the value of a tabular expression for the duration of the query executi
The `materialize()` function is useful in the following scenarios:

* To speed up queries that perform *heavy* calculations whose results are used multiple times in the query.
* To evaluate a tabular expression only once and use it many times in a query. This is commonly required if the tabular expression is non-deterministic. For example, if the expression uses the `rand()` or the `dcount()` functions.
* To evaluate a tabular expression only once and use it many times in a query. This is commonly required if the tabular expression is nondeterministic. For example, if the expression uses the `rand()` or the `dcount()` functions.

> [!NOTE]
> Materialize has a cache size limit of **5 GB**. This limit is per cluster node and is mutual for all queries running concurrently. If a query uses `materialize()` and the cache can't hold any more data, the query will abort with an error.
Expand Down Expand Up @@ -125,7 +125,7 @@ Result set 3:
## Examples of using materialize()

> [!TIP]
> Materialize your column at ingestion time if most of your queries extract fields from dynamic objects across millions of rows.
> Materialize your column at ingestion time if most of your queries extract fields from dynamic objects across millions of rows. In this scenario, use the [Update policy overview](../management/update-policy.md).

To use the `let` statement with a value that you use more than once, use the [materialize() function](materialize-function.md). Try to push all possible operators that will reduce the materialized dataset and still keep the semantics of the query. For example, use filters, or project only required columns.

Expand Down