Request Details

Route
/api_complex GET
Timestamp
Nov 14, 2026 12:13 PM
Duration
309.63 ms
Status
200
Response Size
18 KB
Error
No

Performance Breakdown

Database
3.1% (6 queries)
View Rendering
3.8%
Application Logic
93.1%
Other Operations
0.0%
Total Operations
22
Slowest Operation
309.63 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 748.4ms 1496.8ms 2245.3ms 2993.7ms

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
layouts/application 13 ms 4.2%
home#api_complex 310 ms 100.0%
posts/show 21 ms 6.8%
home#api_complex 310 ms 100.0%
home#api_complex 310 ms 100.0%
home#api_complex 310 ms 100.0%
home#api_complex 310 ms 100.0%
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... 13 ms 4.2%
SELECT * FROM comments WHERE post_id = ? ORDER BY created_at DESC LIMIT ? 12 ms 3.9%
home#api_complex 310 ms 100.0%
home#api_complex 310 ms 100.0%
posts/show 7 ms 2.3%
users/index 32 ms 10.3%
home/index 10 ms 3.2%
layouts/application 12 ms 3.9%
home#api_complex 310 ms 100.0%
SELECT * FROM posts WHERE title LIKE ? AND content LIKE ? AND LOWER(title) LIKE ? AND UPPER(content) LIKE ? 20 ms 6.5%
SELECT * FROM posts WHERE title LIKE ? AND content LIKE ? AND LOWER(title) LIKE ? AND UPPER(content) LIKE ? 26 ms 8.4%
home#api_complex 310 ms 100.0%
SELECT * FROM comments WHERE post_id = ? ORDER BY created_at DESC LIMIT ? 2 ms 0.6%
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... 21 ms 6.8%
layouts/application 18 ms 5.8%