I run this query on log analytics
Perf
| where TimeGenerated >= ago(5m)
| join kind = inner
(
Heartbeat
| where TimeGenerated >= ago(5m)
| summarize arg_max(TimeGenerated, *)
by SourceComputerId
) on Computer
| summarize arg_max(TimeGenerated, *) by SourceComputerId, CounterName
| extend Indicator = strcat(ObjectName,'-', CounterName)
| summarize dict = make_dictionary
(
pack
(
'WorkspaceId'
, TenantId
, Indicator
, CounterValue
, 'TimeGenerated'
, TimeGenerated
, 'Computer'
, Computer
)
) by SourceComputerId
| evaluate bag_unpack(dict)
But it's a little bit slow. Is there any way to optimize it, I want the fastest possible query to achieve the same results.