Insights
What are Scout Insights?
Scout automatically analyzes your application’s traces and surfaces performance issues. The three main insight types are: - N+1 queries - Memory bloat - Slow queries
Each insight includes a saved trace with extended retention for investigation.
What is an N+1 query?
An N+1 query is a database query pattern where N individual queries are executed to retrieve related data instead of a single optimized query, resulting in N+1 total queries. This often happens when iterating over a collection and querying for related records one at a time.
Scout analyzes your traces and surfaces N+1 queries that impact user experience.
How does Scout detect memory bloat?
When a request loads a large number of objects (e.g., many ActiveRecord records), your app may require additional memory. This memory is released slowly, so a single memory-heavy request can have long-term impact on memory usage.
Scout’s Insights dashboard identifies controller-actions and background jobs that trigger significant memory increases, showing an object allocation breakdown by tier (ActiveRecord, ActionView, etc.).
What are Slow Query Insights?
Slow Query Insights analyze your queries across three dimensions:
- Impact on app performance: Based on total time consumed (average latency × throughput)
- Transaction bottlenecks: Queries that consume a large percentage of time in their endpoint or job
- Consistently slow: Queries with high average latency
This helps you focus on database optimizations that will most improve your application.
How do I view historical insights?
The History tab shows past memory bloat, slow query, and N+1 insights. Each insight has a saved trace attached with extended retention beyond the normal trace retention period.
Can I get insights delivered to my email?
Yes. The Insights Email aggregates your newest insights (N+1, slow query, and memory bloat) across all applications at a frequency you choose (daily or weekly). It also includes up to 5 of the slowest web request and background job traces.