explain.depesz.com

PostgreSQL's explain analyze made readable

Result: by13

Settings
# exclusive inclusive rows x rows loops node
1. 0.167 0.167 ↑ 260.5 4 1

CTE Scan on base_and_ancestors namespaces (cost=19,637.59..19,658.43 rows=1,042 width=12) (actual time=0.082..0.167 rows=4 loops=1)

2.          

CTE base_and_ancestors

3. 0.028 0.158 ↑ 260.5 4 1

Recursive Union (cost=638.21..19,637.59 rows=1,042 width=322) (actual time=0.081..0.158 rows=4 loops=1)

4. 0.002 0.086 ↑ 52.0 1 1

Nested Loop (cost=638.21..1,582.75 rows=52 width=322) (actual time=0.068..0.086 rows=1 loops=1)

5. 0.055 0.055 ↑ 271.0 1 1

CTE Scan on base_and_descendants epics_2 (cost=637.78..643.20 rows=271 width=4) (actual time=0.041..0.055 rows=1 loops=1)

6.          

CTE base_and_descendants

7. 0.013 0.054 ↑ 271.0 1 1

Recursive Union (cost=0.29..637.78 rows=271 width=779) (actual time=0.040..0.054 rows=1 loops=1)

8. 0.028 0.028 ↑ 1.0 1 1

Index Scan using epics_pkey on epics (cost=0.29..3.30 rows=1 width=779) (actual time=0.028..0.028 rows=1 loops=1)

  • Index Cond: (id = 15413)
9. 0.001 0.013 ↓ 0.0 0 1

Nested Loop (cost=0.29..62.91 rows=27 width=779) (actual time=0.013..0.013 rows=0 loops=1)

10. 0.001 0.001 ↑ 10.0 1 1

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

11. 0.011 0.011 ↓ 0.0 0 1

Index Scan using index_epics_on_parent_id on epics epics_1 (cost=0.29..6.24 rows=3 width=779) (actual time=0.011..0.011 rows=0 loops=1)

  • Index Cond: (parent_id = base_and_descendants.id)
12. 0.029 0.029 ↑ 1.0 1 1

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

  • Index Cond: (id = epics_2.group_id)
  • Filter: ((type)::text = 'Group'::text)
13. 0.004 0.044 ↑ 99.0 1 4

Nested Loop (cost=0.43..1,803.40 rows=99 width=322) (actual time=0.011..0.011 rows=1 loops=4)

14. 0.000 0.000 ↑ 520.0 1 4

WorkTable Scan on base_and_ancestors (cost=0.00..10.40 rows=520 width=4) (actual time=0.000..0.000 rows=1 loops=4)

15. 0.040 0.040 ↑ 1.0 1 4

Index Scan using namespaces_pkey on namespaces namespaces_2 (cost=0.43..3.44 rows=1 width=322) (actual time=0.010..0.010 rows=1 loops=4)

  • Index Cond: (id = base_and_ancestors.parent_id)
  • Filter: ((type)::text = 'Group'::text)
Planning time : 1.385 ms
Execution time : 0.535 ms