explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 8Y7y : create with with index services (project_id, id) WHERE type = 'PrometheusService' and active = false;

Settings
# exclusive inclusive rows x rows loops node
1. 0.007 83.394 ↑ 1.0 1 1

Aggregate (cost=9,628.10..9,628.11 rows=1 width=8) (actual time=83.394..83.394 rows=1 loops=1)

  • Buffers: shared hit=15501 read=8
  • I/O Timings: read=67.606
2.          

CTE created_records

3. 0.003 83.384 ↓ 0.0 0 1

ModifyTable on public.services (cost=1.56..9,628.08 rows=1 width=1,181) (actual time=83.384..83.384 rows=0 loops=1)

  • Buffers: shared hit=15501 read=8
  • I/O Timings: read=67.606
4. 0.002 83.381 ↓ 0.0 0 1

Nested Loop (cost=1.56..9,628.08 rows=1 width=1,181) (actual time=83.381..83.381 rows=0 loops=1)

  • Buffers: shared hit=15501 read=8
  • I/O Timings: read=67.606
5. 2.441 83.379 ↓ 0.0 0 1

Nested Loop (cost=1.27..9,627.66 rows=1 width=8) (actual time=83.379..83.379 rows=0 loops=1)

  • Buffers: shared hit=15501 read=8
  • I/O Timings: read=67.606
6. 1.278 75.480 ↓ 5,458.0 5,458 1

Merge Left Join (cost=0.99..9,627.34 rows=1 width=8) (actual time=67.812..75.480 rows=5,458 loops=1)

  • Merge Cond: (projects.id = services_1.project_id)
  • Filter: (services_1.id IS NULL)
  • Rows Removed by Filter: 0
  • Buffers: shared hit=4585 read=8
  • I/O Timings: read=67.606
7. 6.430 6.430 ↓ 1.0 5,458 1

Index Scan using projects_pkey on public.projects (cost=0.43..9,535.31 rows=5,311 width=8) (actual time=0.035..6.430 rows=5,458 loops=1)

  • Index Cond: ((projects.id >= 1) AND (projects.id <= 10000))
  • Buffers: shared hit=4581
8. 67.772 67.772 ↓ 0.0 0 1

Index Scan using index_services_on_project_id_and_type on public.services services_1 (cost=0.56..78.71 rows=12 width=8) (actual time=67.772..67.772 rows=0 loops=1)

  • Index Cond: ((services_1.project_id >= 1) AND (services_1.project_id <= 10000) AND ((services_1.type)::text = 'PrometheusService'::text))
  • Buffers: shared hit=4 read=8
  • I/O Timings: read=67.606
9. 5.458 5.458 ↓ 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.001..0.001 rows=0 loops=5,458)

  • Index Cond: (cluster_groups.group_id = projects.namespace_id)
  • Buffers: shared hit=10916
10. 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
11. 83.387 83.387 ↓ 0.0 0 1

CTE Scan on created_records (cost=0.00..0.02 rows=1 width=0) (actual time=83.386..83.387 rows=0 loops=1)

  • Buffers: shared hit=15501 read=8
  • I/O Timings: read=67.606