explain.depesz.com

PostgreSQL's explain analyze made readable

Result: pqTQ

Settings
# exclusive inclusive rows x rows loops node
1. 27.815 119.588 ↑ 196.4 39,840 1

Nested Loop (cost=1,464.13..7,390.86 rows=7,825,540 width=734) (actual time=0.089..119.588 rows=39,840 loops=1)

  • Buffers: shared hit=40,117
2. 0.006 0.072 ↑ 200.0 1 1

HashAggregate (cost=1,463.69..1,465.69 rows=200 width=4) (actual time=0.069..0.072 rows=1 loops=1)

  • Group Key: namespaces.id
  • Buffers: shared hit=8
3. 0.066 0.066 ↑ 821.0 1 1

CTE Scan on base_and_descendants namespaces (cost=1,437.01..1,453.43 rows=821 width=4) (actual time=0.048..0.066 rows=1 loops=1)

  • Buffers: shared hit=8
4.          

CTE base_and_descendants

5. 0.016 0.062 ↑ 821.0 1 1

Recursive Union (cost=0.43..1,437.01 rows=821 width=346) (actual time=0.045..0.062 rows=1 loops=1)

  • Buffers: shared hit=8
6. 0.030 0.030 ↑ 1.0 1 1

Index Scan using namespaces_pkey on public.namespaces namespaces_1 (cost=0.43..3.45 rows=1 width=346) (actual time=0.029..0.030 rows=1 loops=1)

  • Index Cond: (namespaces_1.id = 7,559,438)
  • Buffers: shared hit=4
7. 0.002 0.016 ↓ 0.0 0 1

Nested Loop (cost=0.56..141.71 rows=82 width=346) (actual time=0.016..0.016 rows=0 loops=1)

  • Buffers: shared hit=4
8. 0.002 0.002 ↑ 10.0 1 1

WorkTable Scan on base_and_descendants (cost=0.00..0.20 rows=10 width=4) (actual time=0.001..0.002 rows=1 loops=1)

9. 0.012 0.012 ↓ 0.0 0 1

Index Scan using index_namespaces_on_parent_id_and_id on public.namespaces namespaces_2 (cost=0.56..14.07 rows=8 width=346) (actual time=0.012..0.012 rows=0 loops=1)

  • Index Cond: (namespaces_2.parent_id = base_and_descendants.id)
  • Buffers: shared hit=4
10. 91.701 91.701 ↓ 2,096.8 39,840 1

Index Scan using index_projects_on_namespace_id_and_id on public.projects (cost=0.43..29.44 rows=19 width=734) (actual time=0.017..91.701 rows=39,840 loops=1)

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