Skip to content

Count queries using joins by team

TL;DR

Group engine query logs by team and count how many queries include a JOIN.

Problem / Use case

You want to find which teams are running the most DataPrime queries that include JOIN operations. This helps identify heavy or complex usage patterns for optimization or review.

Query

source system/engine.queries
| filter queryInfo.semanticLabels.containsJoins == true
| groupby clientInfo.originatingTeamId:number as team aggregate count() as queries
| sortby queries desc

Expected output

teamqueries
00742
73108
314159271828
......

Each document shows a team ID and the total number of queries containing join operations, sorted from highest to lowest.

Variations

  • Replace clientInfo.originatingTeamId with clientInfo.originatingUserId to view usage per individual user.
  • Add a time filter such as | filter $m.timestamp > now() - 1d to view recent join activity.