explain.depesz.com

A tool for finding a real cause for slow queries.

Result: NTD6

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 62,480.876 62,480.876 ↓ 16,686.9 133,495 1

CTE Scan on rec_sub_tree (cost=1,465,505.41..1,472,461.19 rows=8 width=132) (actual time=0.067..62,480.876 rows=133,495 loops=1)

  • Filter: ((parent_id IS NULL) AND (forest_id = 'Forest A'::text))
2.          

CTE rec_sub_tree

3. 11,860.699 53,736.585 ↓ 5.3 1,645,992 1

Recursive Union (cost=0.00..1,465,505.41 rows=309,146 width=150) (actual time=0.048..53,736.585 rows=1,645,992 loops=1)

4. 975.796 975.796 ↑ 1.0 247,316 1

Seq Scan on tree_data_1 td (cost=0.00..6,006.16 rows=247,316 width=82) (actual time=0.034..975.796 rows=247,316 loops=1)

5. 21,385.644 40,900.090 ↓ 32.3 199,811 7

Hash Join (cost=13,097.90..145,331.63 rows=6,183 width=150) (actual time=2,087.065..5,842.870 rows=199,811 loops=7)

  • Hash Cond: ((rec.forest_id = td.forest_id) AND (rec.parent_id = td.node_id))
6. 6,410.698 6,410.698 ↑ 5.3 235,142 7

WorkTable Scan on rec_sub_tree rec (cost=0.00..49,463.20 rows=1,236,580 width=132) (actual time=0.017..915.814 rows=235,142 loops=7)

  • Filter: (NOT cycle)
7. 6,994.673 13,103.748 ↑ 1.0 247,316 7

Hash (cost=6,006.16..6,006.16 rows=247,316 width=82) (actual time=1,871.964..1,871.964 rows=247,316 loops=7)

8. 6,109.075 6,109.075 ↑ 1.0 247,316 7

Seq Scan on tree_data_1 td (cost=0.00..6,006.16 rows=247,316 width=82) (actual time=0.017..872.725 rows=247,316 loops=7)