Skip to content

Query Profiling — definition export + execution analysis (umbrella) #342

Closed
9 of 9 issues completed
Closed

Description

@nockawa

Summary

Capture every query that runs during a profiling session as two distinct things — its definition (structural query: filters, sort, target archetype, plus the user's construction file/line) and its executions (per-call instances with actual args, the efficiency chain of spans already in the trace, and — for user-triggered terminals — the user's execution file/line). Surface everything in three new Workbench panels: Query Catalog, Query Plan Tree (graphical), and Execution Inspector.

Design doc: claude/design/Profiler/11-query-definition-export.md

Highlights

  • Use the existing ViewBase.ViewId as the dedup key for View-based queries; add a matching EcsQueryId on EcsQuery so 1-1 mapping between a runtime query instance and its trace-side definition holds for both pipelines.
  • Both source-location flavors (construction and execution) captured via compile-time [CallerFilePath] / [CallerLineNumber] / [CallerMemberName] on the public Query API — zero runtime cost, baked at the user's call site.
  • For scheduler-driven View.Refresh (no user execution site), the Workbench shows the owning system instead, already attributed on the span.
  • New trace sections: QueryDefinitionTable, QuerySourceStringTable. Trace version bumps v15 → v16.
  • New Workbench panels reuse @xyflow/react + dagre (already in SystemDagPanel, SchemaRelationshipsGraph) — no new dependencies.

Phases

Each phase is a separately-trackable sub-issue. Recommended order matches dependencies; P5 alone is a dogfood-ready ship point.

Estimate

~7 days end-to-end.

Sub-issues

Sub-issues

9 of 9 Issues completed
Loading 9 sub-issues

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions