0% found this document useful (0 votes)
18 views1 page

Caution Required While Grouping in Kusto

Uploaded by

saiakkina
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views1 page

Caution Required While Grouping in Kusto

Uploaded by

saiakkina
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

In Kusto Query Language (KQL), you can group records by time intervals as small as

a microsecond using the `bin()` function. However, grouping by a microsecond


(`1µs`) is extremely granular, and Kusto is typically optimized for larger
intervals like seconds or milliseconds. Grouping by microsecond intervals can
result in a vast number of records, which could impact performance.

Here’s how you can write the query to slice records by 1 microsecond and get the
count:

```kql
TableName
| summarize Count = count() by bin(TimestampColumn, 1µs)
| order by TimestampColumn asc
```

### Explanation:
- `bin(TimestampColumn, 1µs)`: This function slices the time by microsecond
intervals.
- `summarize Count = count()`: This aggregates the records for each microsecond
slice.
- `order by TimestampColumn asc`: Orders the results chronologically.

### Caution:
- Grouping by such a small interval (1µs) may not always be practical depending on
the volume of data. If your timestamp data doesn’t have microsecond-level
precision, you might not see much value in grouping at this level.

You might also like