Awesome Reviewers

When writing KQL (hunting queries or ASIM parsers), optimize for fewer rows and fewer expensive computations:

1) Prefilter early (before parse/branch work)

2) Materialize reused datasets

3) Cache expensive expressions

4) Keep dedup correct and efficient

Example pattern

let LatestAgents = materialize(
    AgentsInfo
    | summarize arg_max(Timestamp, *) by AgentId
    | where LifecycleStatus != "Deleted"
);

let AgentToolNames = LatestAgents
| where array_length(DeclaredTools) > 0
| mv-expand Tool = DeclaredTools
| extend ToolName = tostring(Tool.name)
| where isnotempty(ToolName)
| summarize ToolNames = make_set(ToolName) by AgentId;

LatestAgents
| join kind=leftouter AgentToolNames on AgentId

Checklist