Operation 198630

SELECT DISTINCT users.*, posts.*, comments.* FROM users, posts, comments WHERE users.id = posts.user_id AND posts.id = comments.post_id AND users.created_at > ? AND posts.created_at > ? AND comments.created_at > ?
Operation Type
sql
Duration
15.0 ms
Request Impact
67.1% of total request time
Occurred At
Sep 22, 2026 11:41 PM
SQL Analysis
Normal query (<100 ms)
Performance Comparison
Average: 18.1ms
95th Percentile: 34.0ms
Based on 1000 recent operations
Related Operations
2 similar operations in this request
Optimization Tips
Use includes() to eager load associations - Eliminate N+1 queries and reduce database load
Use joins() when you only need to filter, not access associated data - Eliminate N+1 queries and reduce database load
Use preload() when you don't need to query on associations - Eliminate N+1 queries and reduce database load
Add composite index: add_index :users, ["id", "created_at"] - Efficient multi-column filtering
Add single_column index: add_index :users, :created_at - Efficient range scans for created_at
Index Optimization - Review indexes on the 'users' table. Consider composite indexes for WHERE clauses.