explain.depesz.com

PostgreSQL's explain analyze made readable

Result: BA1 : update with exec index services (project_id, id) WHERE type = 'PrometheusService' and active = false OR active IS NULL;

Settings
# exclusive inclusive rows x rows loops node
1. 0.008 712.202 ↑ 1.0 1 1

Aggregate (cost=613.44..613.45 rows=1 width=8) (actual time=712.202..712.202 rows=1 loops=1)

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

CTE updated_records

3. 0.000 712.191 ↓ 0.0 0 1

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

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

Initplan (for ModifyTable on public.services)

5. 0.001 712.159 ↓ 0.0 0 1

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

  • Buffers: shared hit=11510 read=3989 dirtied=71
  • I/O Timings: read=672.990
6. 3.748 712.158 ↓ 0.0 0 1

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

  • Buffers: shared hit=11510 read=3989 dirtied=71
  • I/O Timings: read=672.990
7. 692.036 692.036 ↓ 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=0.305..692.036 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=672.718
8. 16.374 16.374 ↓ 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.003..0.003 rows=0 loops=5,458)

  • Index Cond: (cluster_groups.group_id = projects.namespace_id)
  • Buffers: shared hit=10910 read=6
  • I/O Timings: read=0.272
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. 712.188 712.188 ↓ 0.0 0 1

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

  • Buffers: shared hit=11510 read=3989 dirtied=71
  • I/O Timings: read=672.990
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. 712.194 712.194 ↓ 0.0 0 1

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

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