explain.depesz.com

PostgreSQL's explain analyze made readable

Result: xFNK

Settings
# exclusive inclusive rows x rows loops node
1. 0.957 10.301 ↑ 2.7 1,102 1

Nested Loop (cost=1,425.47..6,198.78 rows=2,985 width=734) (actual time=3.240..10.301 rows=1,102 loops=1)

  • Buffers: shared hit=2,589
2. 0.281 3.392 ↓ 1.2 186 1

HashAggregate (cost=1,425.04..1,426.65 rows=161 width=4) (actual time=3.219..3.392 rows=186 loops=1)

  • Group Key: namespaces.id
  • Buffers: shared hit=924
3. 3.111 3.111 ↓ 1.2 186 1

CTE Scan on base_and_descendants namespaces (cost=1,419.81..1,423.03 rows=161 width=4) (actual time=0.058..3.111 rows=186 loops=1)

  • Buffers: shared hit=924
4.          

CTE base_and_descendants

5. 1.123 2.809 ↓ 1.2 186 1

Recursive Union (cost=0.43..1,419.81 rows=161 width=346) (actual time=0.053..2.809 rows=186 loops=1)

  • Buffers: shared hit=924
6. 0.041 0.041 ↑ 1.0 1 1

Index Scan using index_namespaces_on_type_and_id_partial on public.namespaces namespaces_1 (cost=0.43..3.45 rows=1 width=346) (actual time=0.040..0.041 rows=1 loops=1)

  • Index Cond: (((namespaces_1.type)::text = 'Group'::text) AND (namespaces_1.id = 9,970))
  • Buffers: shared hit=4
7. 0.313 1.645 ↓ 2.3 37 5

Nested Loop (cost=0.56..141.31 rows=16 width=346) (actual time=0.033..0.329 rows=37 loops=5)

  • Buffers: shared hit=920
8. 0.030 0.030 ↓ 3.7 37 5

WorkTable Scan on base_and_descendants (cost=0.00..0.20 rows=10 width=4) (actual time=0.000..0.006 rows=37 loops=5)

9. 1.302 1.302 ↑ 2.0 1 186

Index Scan using index_namespaces_on_parent_id_and_id on public.namespaces namespaces_2 (cost=0.56..14.09 rows=2 width=346) (actual time=0.005..0.007 rows=1 loops=186)

  • Index Cond: (namespaces_2.parent_id = base_and_descendants.id)
  • Filter: ((namespaces_2.type)::text = 'Group'::text)
  • Rows Removed by Filter: 0
  • Buffers: shared hit=920
10. 5.952 5.952 ↑ 3.2 6 186

Index Scan using index_projects_on_namespace_id_and_id on public.projects (cost=0.43..29.45 rows=19 width=734) (actual time=0.009..0.032 rows=6 loops=186)

  • Index Cond: (projects.namespace_id = namespaces.id)
  • Buffers: shared hit=1,665