Request Details

Route
/api_complex GET
Timestamp
Sep 23, 2026 2:41 AM
Duration
237.59 ms
Status
200
Response Size
29 KB
Error
No

Performance Breakdown

Database
6.7% (10 queries)
View Rendering
6.5%
Application Logic
86.8%
Other Operations
0.0%
Total Operations
22
Slowest Operation
237.59 ms

Request Trace

How to read this

Each row is a layer of your stack. Many short Database bars means N+1 queries — fix with includes(). A wide Action bar with little Database time means slow Ruby code. A wide View bar usually means a partial rendered in a loop.

Action
View
Database
Other
Action
View
Database
0.0ms 478.8ms 957.6ms 1436.3ms 1915.1ms

Operations

How to use this

Sort by Impact to find your biggest wins. Click any row for details and optimisation suggestions. The same SQL appearing multiple times is an N+1 — fix with includes(). A single operation above 50% impact is your highest priority.

Operation Duration Impact Timeline Actions
users/index 29 ms 12.2%
home#api_complex 238 ms 100.0%
SELECT * FROM comments WHERE post_id = ? ORDER BY created_at DESC LIMIT ? 17 ms 7.2%
home/index 32 ms 13.5%
home/index 21 ms 8.8%
SELECT * FROM (SELECT users.id, users.name, users.email, COUNT(posts.id) as post_count FROM users LEFT JOIN posts ON users.id = posts.user_id WHERE users.active = ? GROUP BY users.id) as user_posts JOIN (SELECT user_id, COUNT(*) as comment_count FROM c... 29 ms 12.2%
SELECT users.*, posts.*, comments.*, COUNT(DISTINCT posts.id) as post_count, COUNT(DISTINCT comments.id) as comment_count, AVG(posts.view_count) as avg_views, MAX(comments.created_at) as latest_comment FROM users LEFT JOIN posts ON users.id = posts.use... 18 ms 7.6%
home#api_complex 238 ms 100.0%
home#api_complex 238 ms 100.0%
layouts/application 37 ms 15.6%
home#api_complex 238 ms 100.0%
home#api_complex 238 ms 100.0%
users/index 5 ms 2.1%
home#api_complex 238 ms 100.0%
SELECT users.*, COUNT(DISTINCT posts.id) as post_count, COUNT(DISTINCT comments.id) as comment_count, SUM(posts.view_count) as total_views, AVG(posts.view_count) as avg_views, MIN(posts.created_at) as first_post, MAX(posts.created_at) as latest_post FR... 17 ms 7.2%
SELECT users.*, COUNT(DISTINCT posts.id) as post_count, COUNT(DISTINCT comments.id) as comment_count, SUM(posts.view_count) as total_views, AVG(posts.view_count) as avg_views, MIN(posts.created_at) as first_post, MAX(posts.created_at) as latest_post FR... 6 ms 2.5%
SELECT users.*, COUNT(DISTINCT posts.id) as post_count, COUNT(DISTINCT comments.id) as comment_count, SUM(posts.view_count) as total_views, AVG(posts.view_count) as avg_views, MIN(posts.created_at) as first_post, MAX(posts.created_at) as latest_post FR... 2 ms 0.8%
SELECT posts.title, posts.content, users.name FROM posts JOIN users ON posts.user_id = users.id WHERE posts.published = ? 18 ms 7.6%
SELECT * FROM users WHERE id = ? 7 ms 2.9%
SELECT * FROM posts WHERE user_id = ? ORDER BY created_at DESC LIMIT ? 4 ms 1.7%
home#api_complex 238 ms 100.0%
SELECT * FROM (SELECT users.id, users.name, users.email, COUNT(posts.id) as post_count FROM users LEFT JOIN posts ON users.id = posts.user_id WHERE users.active = ? GROUP BY users.id) as user_posts JOIN (SELECT user_id, COUNT(*) as comment_count FROM c... 10 ms 4.2%