explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ro8F : update with index services (project_id, id) WHERE type = 'PrometheusService' and active = false;

Settings
# exclusive inclusive rows x rows loops node
1. 0.006 4,022.532 ↑ 1.0 1 1

Aggregate (cost=613.44..613.45 rows=1 width=8) (actual time=4,022.532..4,022.532 rows=1 loops=1)

  • Buffers: shared hit=11510 read=3989 dirtied=71
  • I/O Timings: read=3950.407
2.          

CTE updated_records

3. 0.000 4,022.523 ↓ 0.0 0 1

ModifyTable on public.services (cost=593.60..613.28 rows=7 width=224) (actual time=4,022.523..4,022.523 rows=0 loops=1)

  • Buffers: shared hit=11510 read=3989 dirtied=71
  • I/O Timings: read=3950.407
4.          

Initplan (for ModifyTable on public.services)

5. 0.000 4,022.517 ↓ 0.0 0 1

Nested Loop (cost=1.00..11,255.09 rows=19 width=0) (actual time=4,022.517..4,022.517 rows=0 loops=1)

  • Buffers: shared hit=11510 read=3989 dirtied=71
  • I/O Timings: read=3950.407
6. 13.542 4,022.517 ↓ 0.0 0 1

Nested Loop (cost=0.72..11,244.45 rows=27 width=4) (actual time=4,022.517..4,022.517 rows=0 loops=1)

  • Buffers: shared hit=11510 read=3989 dirtied=71
  • I/O Timings: read=3950.407
7. 3,981.685 3,981.685 ↓ 1.0 5,458 1

Index Scan using projects_pkey on public.projects (cost=0.43..9,535.31 rows=5,311 width=4) (actual time=3.087..3,981.685 rows=5,458 loops=1)

  • Index Cond: ((projects.id >= 1) AND (projects.id <= 10000))
  • Buffers: shared hit=600 read=3983 dirtied=71
  • I/O Timings: read=3944.888
8. 27.290 27.290 ↓ 0.0 0 5,458

Index Scan using index_cluster_groups_on_group_id on public.cluster_groups (cost=0.28..0.31 rows=1 width=8) (actual time=0.005..0.005 rows=0 loops=5,458)

  • Index Cond: (cluster_groups.group_id = projects.namespace_id)
  • Buffers: shared hit=10910 read=6
  • I/O Timings: read=5.519
9. 0.000 0.000 ↓ 0.0 0 0

Index Scan using index_clusters_applications_prometheus_on_cluster_id on public.clusters_applications_prometheus (cost=0.29..0.38 rows=1 width=4) (actual time=0.000..0.000 rows=0 loops=0)

  • Index Cond: (clusters_applications_prometheus.cluster_id = cluster_groups.cluster_id)
  • Filter: (clusters_applications_prometheus.status = ANY ('{3,5}'::integer[]))
  • Rows Removed by Filter: 0
10. 4,022.521 4,022.521 ↓ 0.0 0 1

Result (cost=0.28..19.96 rows=7 width=224) (actual time=4,022.521..4,022.521 rows=0 loops=1)

  • Buffers: shared hit=11510 read=3989 dirtied=71
  • I/O Timings: read=3950.407
11. 0.000 0.000 ↓ 0.0 0 0

Index Scan using temp_partial_indx_project_id_id on public.services (cost=0.28..19.96 rows=7 width=224) (actual time=0.000..0.000 rows=0 loops=0)

  • Index Cond: ((services.project_id >= 1) AND (services.project_id <= 10000))
  • Filter: ((NOT services.active) AND (services.properties = '{}'::text) AND ((services.type)::text = 'PrometheusService'::text))
  • Rows Removed by Filter: 0
12. 4,022.526 4,022.526 ↓ 0.0 0 1

CTE Scan on updated_records (cost=0.00..0.14 rows=7 width=0) (actual time=4,022.526..4,022.526 rows=0 loops=1)

  • Buffers: shared hit=11510 read=3989 dirtied=71
  • I/O Timings: read=3950.407