What problem does it solve?
This Skill helps you identify and eliminate common Rails runtime performance problems like N+1 queries, slow SQL, missing indexes, memory growth, and inefficient response paths.
Core Features & Use Cases
- N+1 detection and prevention (Bullet + eager loading): Use Bullet to detect N+1 behavior and apply includes/preload/eager_load patterns to reduce query counts.
- Query and database optimization: Optimize slow queries using EXPLAIN, targeted indexing (including composite/partial/covering indexes), and better ActiveRecord patterns (select/pluck, exists?).
- Memory and throughput improvements: Reduce memory bloat with batching (find_each/in_batches), streaming-friendly querying (pluck/enumerators), and safer update strategies (update_all).
- Profiling and test validation: Use rack-mini-profiler for request profiling and add query-count assertions in tests to prevent regressions.
Quick Start
Ask the AI to review your Rails endpoint for N+1 queries and return the exact eager-loading changes needed to reduce the query count, then verify the result with a Bullet-based test configuration.