explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4Yah

Settings
# exclusive inclusive rows x rows loops node
1. 0.141 0.141 ↑ 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.067..0.141 rows=4 loops=1)

2.          

CTE base_and_ancestors

3. 0.027 0.133 ↑ 260.5 4 1

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

4. 0.003 0.066 ↑ 52.0 1 1

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

5. 0.041 0.041 ↑ 271.0 1 1

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

6.          

CTE fos

7. 0.008 0.037 ↑ 271.0 1 1

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

8. 0.019 0.019 ↑ 1.0 1 1

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

  • Index Cond: (id = 15413)
9. 0.000 0.010 ↓ 0.0 0 1

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

10. 0.001 0.001 ↑ 10.0 1 1

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

11. 0.009 0.009 ↓ 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.009..0.009 rows=0 loops=1)

  • Index Cond: (parent_id = fos.id)
12. 0.022 0.022 ↑ 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.019..0.022 rows=1 loops=1)

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

Nested Loop (cost=0.43..1,803.40 rows=99 width=322) (actual time=0.010..0.010 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.009..0.010 rows=1 loops=4)

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