EctoDoctor.RepeatedQueries.Finding (Ecto Doctor v0.0.1)

Copy Markdown View Source

Describes one N+1 query. The same query ran count times from the same call stack in one unit of work.

The :origin is the first frame in your own code outside the repo, which is usually the line to change.

The :key is what the baseline file stores. It leaves out line numbers so editing the code around a known N+1 doesn't make it new again.

Summary

Types

frame()

@type frame() :: {module(), atom(), arity(), String.t(), nil | pos_integer()}

t()

@type t() :: %EctoDoctor.RepeatedQueries.Finding{
  count: pos_integer(),
  duration_ms: float(),
  fix: nil | String.t(),
  frames: [frame()],
  key: String.t(),
  label: nil | String.t(),
  origin: nil | frame(),
  sql: String.t()
}