P95 Query Time
37 ms
Compared to previous 7 days
Query Responses
Click marker to copy SHA
| Time Period | Executions | Avg Duration | Min Duration ▼ | Max Duration |
|---|---|---|---|---|
| Nov 8, 2026 | 4 | 34.75 ms | 27.0 ms | 45.0 ms |
| Nov 22, 2026 | 4 | 26.5 ms | 20.0 ms | 29.0 ms |
| Nov 13, 2026 | 15 | 18.53 ms | 7.0 ms | 50.0 ms |
| Nov 15, 2026 | 7 | 15.0 ms | 5.0 ms | 30.0 ms |
| Nov 11, 2026 | 18 | 21.67 ms | 4.0 ms | 48.0 ms |
| Nov 9, 2026 | 11 | 17.36 ms | 3.0 ms | 46.0 ms |
| Nov 16, 2026 | 14 | 21.86 ms | 3.0 ms | 34.0 ms |
| Nov 19, 2026 | 10 | 19.5 ms | 3.0 ms | 32.0 ms |
| Nov 21, 2026 | 8 | 17.63 ms | 3.0 ms | 35.0 ms |
| Nov 12, 2026 | 18 | 14.89 ms | 2.0 ms | 43.0 ms |
Total of 15 record(s).
Page 1 of 2
Normalized Query
SELECT COUNT(*) FROM comments WHERE post_id = ?
Diagnostics
Query Characteristics
- Query Type
- SELECT
- Tables
- 1
- Joins
- 0
- Complexity Score
- 3
- Has LIMIT
- No
- Has ORDER BY
- No
- Has GROUP BY
- No
- Has Subqueries
- No
Optimization Suggestions
-
Add single_column index: add_index :comments, :post_id
— Fast lookups for post_id = value queries
add_index :comments, :post_id
Execution Plan
3 | 0 | 53 | SEARCH comments USING COVERING INDEX index_comments_on_post_id (post_id=?)
Query Locations
| Location | P95 Duration (ms) | P95 Row Count | Count |
|---|---|---|---|
app/models/post.rb:18 |
34.0 | — | 174 |
app/mailers/user_mailer.rb:41 |
30.0 | — | 1 |
app/jobs/cache_warming_job.rb:109 |
45.0 | — | 1 |
app/jobs/image_processing_job.rb:97 |
16.0 | — | 1 |
app/jobs/webhook_delivery_job.rb:99 |
4.0 | — | 1 |
app/jobs/notification_job.rb:50 |
22.0 | — | 1 |
app/jobs/notification_job.rb:111 |
41.0 | — | 1 |
app/jobs/cache_warming_job.rb:26 |
7.0 | — | 1 |
app/jobs/cache_warming_job.rb:31 |
10.0 | — | 1 |
app/jobs/image_processing_job.rb:53 |
50.0 | — | 1 |
app/jobs/cache_warming_job.rb:65 |
3.0 | — | 1 |
app/jobs/cache_warming_job.rb:16 |
43.0 | — | 1 |
app/jobs/cache_warming_job.rb:113 |
20.0 | — | 1 |
app/mailers/user_mailer.rb:14 |
39.0 | — | 1 |
app/jobs/image_processing_job.rb:13 |
7.0 | — | 1 |
app/jobs/notification_job.rb:20 |
5.0 | — | 1 |
app/jobs/report_generator_job.rb:83 |
28.0 | — | 1 |
app/jobs/webhook_delivery_job.rb:71 |
48.0 | — | 1 |
app/jobs/cache_warming_job.rb:115 |
47.0 | — | 1 |
app/mailers/user_mailer.rb:51 |
28.0 | — | 1 |
app/jobs/cache_warming_job.rb:72 |
13.0 | — | 1 |
app/jobs/cleanup_job.rb:98 |
15.0 | — | 1 |
app/jobs/notification_job.rb:49 |
47.0 | — | 1 |
app/jobs/cache_warming_job.rb:49 |
38.0 | — | 1 |
app/jobs/data_export_job.rb:26 |
48.0 | — | 1 |
app/jobs/cache_warming_job.rb:55 |
8.0 | — | 1 |
app/jobs/cache_warming_job.rb:105 |
20.0 | — | 1 |
app/jobs/cache_warming_job.rb:97 |
20.0 | — | 1 |
app/jobs/notification_job.rb:29 |
4.0 | — | 1 |
app/jobs/image_processing_job.rb:55 |
46.0 | — | 1 |
app/jobs/import_job.rb:118 |
42.0 | — | 1 |
app/jobs/cache_warming_job.rb:23 |
33.0 | — | 1 |
app/jobs/image_processing_job.rb:39 |
34.0 | — | 1 |
app/jobs/notification_job.rb:45 |
45.0 | — | 1 |
Raw Data
{
"query": {
"id": 7225,
"normalized_sql": "SELECT COUNT(*) FROM comments WHERE post_id = ?",
"analyzed_at": "2026-11-22 14:02:27 UTC"
},
"performance": {
"total_executions": 207,
"p95_duration_ms": "41.0",
"avg_duration_ms": 19.2319,
"p95_row_count": null,
"avg_row_count": null
},
"characteristics": {
"query_type": "SELECT",
"table_count": 1,
"join_count": 0,
"where_clause_complexity": 1,
"has_subqueries": false,
"has_limit": false,
"has_order_by": false,
"has_group_by": false,
"has_having": false,
"has_distinct": false,
"has_aggregations": true,
"estimated_complexity": 3
},
"call_locations": [
{
"location": "app/models/post.rb:18",
"count": 174,
"p95_duration_ms": "34.0",
"p95_row_count": null
},
{
"location": "app/mailers/user_mailer.rb:41",
"count": 1,
"p95_duration_ms": "30.0",
"p95_row_count": null
},
{
"location": "app/jobs/cache_warming_job.rb:109",
"count": 1,
"p95_duration_ms": "45.0",
"p95_row_count": null
},
{
"location": "app/jobs/image_processing_job.rb:97",
"count": 1,
"p95_duration_ms": "16.0",
"p95_row_count": null
},
{
"location": "app/jobs/webhook_delivery_job.rb:99",
"count": 1,
"p95_duration_ms": "4.0",
"p95_row_count": null
},
{
"location": "app/jobs/notification_job.rb:50",
"count": 1,
"p95_duration_ms": "22.0",
"p95_row_count": null
},
{
"location": "app/jobs/notification_job.rb:111",
"count": 1,
"p95_duration_ms": "41.0",
"p95_row_count": null
},
{
"location": "app/jobs/cache_warming_job.rb:26",
"count": 1,
"p95_duration_ms": "7.0",
"p95_row_count": null
},
{
"location": "app/jobs/cache_warming_job.rb:31",
"count": 1,
"p95_duration_ms": "10.0",
"p95_row_count": null
},
{
"location": "app/jobs/image_processing_job.rb:53",
"count": 1,
"p95_duration_ms": "50.0",
"p95_row_count": null
},
{
"location": "app/jobs/cache_warming_job.rb:65",
"count": 1,
"p95_duration_ms": "3.0",
"p95_row_count": null
},
{
"location": "app/jobs/cache_warming_job.rb:16",
"count": 1,
"p95_duration_ms": "43.0",
"p95_row_count": null
},
{
"location": "app/jobs/cache_warming_job.rb:113",
"count": 1,
"p95_duration_ms": "20.0",
"p95_row_count": null
},
{
"location": "app/mailers/user_mailer.rb:14",
"count": 1,
"p95_duration_ms": "39.0",
"p95_row_count": null
},
{
"location": "app/jobs/image_processing_job.rb:13",
"count": 1,
"p95_duration_ms": "7.0",
"p95_row_count": null
},
{
"location": "app/jobs/notification_job.rb:20",
"count": 1,
"p95_duration_ms": "5.0",
"p95_row_count": null
},
{
"location": "app/jobs/report_generator_job.rb:83",
"count": 1,
"p95_duration_ms": "28.0",
"p95_row_count": null
},
{
"location": "app/jobs/webhook_delivery_job.rb:71",
"count": 1,
"p95_duration_ms": "48.0",
"p95_row_count": null
},
{
"location": "app/jobs/cache_warming_job.rb:115",
"count": 1,
"p95_duration_ms": "47.0",
"p95_row_count": null
},
{
"location": "app/mailers/user_mailer.rb:51",
"count": 1,
"p95_duration_ms": "28.0",
"p95_row_count": null
},
{
"location": "app/jobs/cache_warming_job.rb:72",
"count": 1,
"p95_duration_ms": "13.0",
"p95_row_count": null
},
{
"location": "app/jobs/cleanup_job.rb:98",
"count": 1,
"p95_duration_ms": "15.0",
"p95_row_count": null
},
{
"location": "app/jobs/notification_job.rb:49",
"count": 1,
"p95_duration_ms": "47.0",
"p95_row_count": null
},
{
"location": "app/jobs/cache_warming_job.rb:49",
"count": 1,
"p95_duration_ms": "38.0",
"p95_row_count": null
},
{
"location": "app/jobs/data_export_job.rb:26",
"count": 1,
"p95_duration_ms": "48.0",
"p95_row_count": null
},
{
"location": "app/jobs/cache_warming_job.rb:55",
"count": 1,
"p95_duration_ms": "8.0",
"p95_row_count": null
},
{
"location": "app/jobs/cache_warming_job.rb:105",
"count": 1,
"p95_duration_ms": "20.0",
"p95_row_count": null
},
{
"location": "app/jobs/cache_warming_job.rb:97",
"count": 1,
"p95_duration_ms": "20.0",
"p95_row_count": null
},
{
"location": "app/jobs/notification_job.rb:29",
"count": 1,
"p95_duration_ms": "4.0",
"p95_row_count": null
},
{
"location": "app/jobs/image_processing_job.rb:55",
"count": 1,
"p95_duration_ms": "46.0",
"p95_row_count": null
},
{
"location": "app/jobs/import_job.rb:118",
"count": 1,
"p95_duration_ms": "42.0",
"p95_row_count": null
},
{
"location": "app/jobs/cache_warming_job.rb:23",
"count": 1,
"p95_duration_ms": "33.0",
"p95_row_count": null
},
{
"location": "app/jobs/image_processing_job.rb:39",
"count": 1,
"p95_duration_ms": "34.0",
"p95_row_count": null
},
{
"location": "app/jobs/notification_job.rb:45",
"count": 1,
"p95_duration_ms": "45.0",
"p95_row_count": null
}
],
"n_plus_one": {
"detected": false
},
"index_recommendations": [
"add_index :comments, :post_id"
],
"issues": [],
"explain_plan": "3 | 0 | 53 | SEARCH comments USING COVERING INDEX index_comments_on_post_id (post_id=?)"
}