explain.depesz.com

PostgreSQL's explain analyze made readable

Result: AuB5

Settings
# exclusive inclusive rows x rows loops node
1. 1.118 696.055 ↓ 74.7 5,531 1

Group (cost=2,039.42..2,039.79 rows=74 width=4) (actual time=694.206..696.055 rows=5,531 loops=1)

  • Group Key: projects.id
  • Buffers: shared hit=44,343 read=2,980
  • I/O Timings: read=506.326
2. 3.652 694.937 ↓ 84.3 6,235 1

Sort (cost=2,039.42..2,039.60 rows=74 width=4) (actual time=694.204..694.937 rows=6,235 loops=1)

  • Sort Key: projects.id
  • Sort Method: quicksort Memory: 485kB
  • Buffers: shared hit=44,343 read=2,980
  • I/O Timings: read=506.326
3. 7.133 691.285 ↓ 84.3 6,235 1

Nested Loop Left Join (cost=177.23..2,037.12 rows=74 width=4) (actual time=13.496..691.285 rows=6,235 loops=1)

  • Filter: ((services.id IS NULL) OR ((NOT services.active) AND (services.properties = '{}'::text)))
  • Rows Removed by Filter: 729
  • Buffers: shared hit=44,343 read=2,980
  • I/O Timings: read=506.326
4. 1.630 120.068 ↓ 62.2 6,964 1

Nested Loop (cost=176.80..1,981.39 rows=112 width=4) (actual time=13.405..120.068 rows=6,964 loops=1)

  • Buffers: shared hit=20,646 read=280
  • I/O Timings: read=21.850
5. 0.671 40.969 ↓ 11.0 651 1

Nested Loop (cost=176.37..1,922.84 rows=59 width=8) (actual time=13.367..40.969 rows=651 loops=1)

  • Buffers: shared hit=11,806 read=78
  • I/O Timings: read=10.623
6. 0.159 28.580 ↓ 11.0 651 1

Nested Loop (cost=175.93..1,811.09 rows=59 width=4) (actual time=13.306..28.580 rows=651 loops=1)

  • Join Filter: (cluster_groups.cluster_id = clusters.id)
  • Buffers: shared hit=9,316 read=76
  • I/O Timings: read=10.600
7. 1.346 23.213 ↑ 3.2 651 1

Merge Join (cost=175.65..609.99 rows=2,080 width=12) (actual time=13.263..23.213 rows=651 loops=1)

  • Merge Cond: (cluster_groups.cluster_id = clusters_applications_prometheus.cluster_id)
  • Buffers: shared hit=7,359 read=76
  • I/O Timings: read=10.600
8. 2.080 2.080 ↓ 1.0 3,012 1

Index Only Scan using index_cluster_groups_on_cluster_id_and_group_id on cluster_groups (cost=0.28..90.19 rows=3,002 width=8) (actual time=0.036..2.080 rows=3,012 loops=1)

  • Heap Fetches: 1,972
  • Buffers: shared hit=666
9. 19.787 19.787 ↓ 1.0 5,271 1

Index Scan using index_clusters_applications_prometheus_on_cluster_id on clusters_applications_prometheus (cost=0.28..479.72 rows=5,267 width=4) (actual time=2.068..19.787 rows=5,271 loops=1)

  • Filter: (status = ANY ('{3,5}'::integer[]))
  • Rows Removed by Filter: 2,332
  • Buffers: shared hit=6,693 read=76
  • I/O Timings: read=10.600
10. 5.208 5.208 ↑ 1.0 1 651

Index Scan using clusters_pkey on clusters (cost=0.29..0.56 rows=1 width=4) (actual time=0.007..0.008 rows=1 loops=651)

  • Index Cond: (id = clusters_applications_prometheus.cluster_id)
  • Filter: (cluster_type = 2)
  • Buffers: shared hit=1,957
11. 11.718 11.718 ↑ 1.0 1 651

Index Only Scan using namespaces_pkey on namespaces (cost=0.43..1.88 rows=1 width=4) (actual time=0.018..0.018 rows=1 loops=651)

  • Index Cond: (id = cluster_groups.group_id)
  • Heap Fetches: 192
  • Buffers: shared hit=2,490 read=2
  • I/O Timings: read=0.023
12. 77.469 77.469 ↑ 1.5 11 651

Index Scan using index_projects_on_namespace_id on projects (cost=0.43..0.83 rows=16 width=8) (actual time=0.039..0.119 rows=11 loops=651)

  • Index Cond: (namespace_id = namespaces.id)
  • Buffers: shared hit=8,840 read=202
  • I/O Timings: read=11.227
13. 564.084 564.084 ↓ 0.0 0 6,964

Index Scan using index_services_on_project_id on services (cost=0.43..0.49 rows=1 width=45) (actual time=0.077..0.081 rows=0 loops=6,964)

  • Index Cond: (project_id = projects.id)
  • Filter: ((type)::text = 'PrometheusService'::text)
  • Rows Removed by Filter: 1
  • Buffers: shared hit=23,697 read=2,700
  • I/O Timings: read=484.476
Planning time : 6.714 ms
Execution time : 696.457 ms