How would you approach optimizing a slow-running SQL query in Distyl AI's production systems?
For this exercise, use the supplied execution, model, and workspace data to produce a baseline report of slow production workloads. Exclude executions without a duration, and explain how the query structure supports performance analysis.
Output
- One row per qualifying production workspace with
workspace_name, completed_queries, average_duration_ms, and slowest_duration_ms.
- Ignore rows where
duration_ms is NULL, and include only active models, completed executions from October 1, 2026 onward, and workspaces with an average duration above 1,000 milliseconds.
- Order by average duration descending, then workspace name ascending.