Information about a potential N+1 query passed to the configured :on_detect callback.
A detection represents one parameterized query shape after it crosses the configured execution and parameter-variant thresholds.
The fields are:
:query- the parameterized SQL string with surrounding whitespace removed:repoand:source- the Repo and Ecto source that emitted the query:operation- the classified SQL operation:count- executions observed in the active window when detection occurred:parameter_variants- distinct parameter signatures observed:params- retained parameter samples, empty unless:include_paramsis enabled:callsite- the nearest frame under a configured application module:stacktrace- every matching application frame used to group the query:total_time- accumulated Ecto:total_timein native time units
Summary
Types
@type operation() :: :select | :insert | :update | :delete | :transaction | :other
@type t() :: %EctoNPlusOne.Detection{ callsite: Exception.stacktrace_entry(), count: pos_integer(), operation: operation(), parameter_variants: pos_integer(), params: [term()], query: String.t(), repo: module(), source: term(), stacktrace: Exception.stacktrace(), total_time: non_neg_integer() }
A potential N+1 query detected from Ecto telemetry events.