Ecto N+1 Query Auditor
Identifies and remediates N+1 query anti-patterns in Elixir Ecto code to optimize database performance.
Ecto N+1 Query Auditor is a specialized capability for Elixir and Phoenix developers that scans codebases for inefficient database access patterns. It focuses on identifying Ecto.Repo calls trapped inside loops, lazy association loading, and missing nested preloads that cause performance degradation. By enforcing strict 'Iron Laws' for database efficiency, this skill helps developers refactor their code toward batch queries, eager loading, and proper context-boundary preloading, ensuring Phoenix applications remain fast and scalable.
主な機能
01Provides automated grep-based analysis for rapid project-wide audits
0262 GitHub stars
03Detects missing nested preloads in complex data relationships
04Enforces best practices for preloading at context boundaries rather than views
05Scans for Repo calls inside Enum.map, each, and for-comprehension loops
06Identifies association access patterns that trigger hidden lazy loading
ユースケース
01Debugging slow application responses reported in logs caused by high query volume
02Auditing an existing Phoenix application for performance bottlenecks and excessive SQL queries
03Refactoring legacy Ecto code to implement eager loading and batch query patterns