Operation 139346
SELECT * FROM posts WHERE user_id = ? ORDER BY created_at DESC LIMIT ?
- Operation Type
sql
- Duration
- 33.0 ms
- Request Impact
- 7.7% of total request time
- Occurred At
- Sep 21, 2026 9:47 AM
- SQL Analysis
- Normal query (<100 ms)
- Performance Comparison
-
Average: 18.2ms
95th Percentile: 34.0ms
Based on 1000 recent operations - Related Operations
-
5 similar operations in this request
Potential N+1 query pattern detected - Optimization Tips
-
Add composite index: add_index :posts, ["user_id", "created_at"] - Single index for filtering and sortingAdd single_column index: add_index :posts, :user_id - Fast lookups for user_id = value queriesAdd single_column index: add_index :posts, :created_at - Avoid sorting for ORDER BY created_atSpecify only needed columns instead of SELECT * - Reduced memory usage and faster data transferIndex Optimization - Review indexes on the 'posts' table. Consider composite indexes for WHERE clauses.