explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ldTg

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Merge Join (cost=13,032,101.77..19,345,200.56 rows=8,891,228 width=1,967) (actual rows= loops=)

  • Merge Cond: (workflow_histories.id = r.id)
2. 0.000 0.000 ↓ 0.0

Index Scan using workflow_histories_pkey on workflow_histories (cost=0.44..6,268,640.08 rows=17,782,457 width=1,967) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Sort (cost=13,032,101.33..13,032,101.83 rows=200 width=8) (actual rows= loops=)

  • Sort Key: r.id
4. 0.000 0.000 ↓ 0.0

HashAggregate (cost=13,032,091.69..13,032,093.69 rows=200 width=8) (actual rows= loops=)

  • Group Key: r.id
5. 0.000 0.000 ↓ 0.0

CTE Scan on r (cost=12,812,876.40..12,947,778.12 rows=6,745,086 width=8) (actual rows= loops=)

6.          

CTE r

7. 0.000 0.000 ↓ 0.0

Recursive Union (cost=0.44..12,812,876.40 rows=6,745,086 width=1,967) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Index Scan using index_workflow_histories_on_fiber_id on workflow_histories workflow_histories_1 (cost=0.44..224.32 rows=166 width=1,967) (actual rows= loops=)

  • Index Cond: (fiber_id = 2539741)
9. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.56..1,267,775.04 rows=674,492 width=1,967) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

WorkTable Scan on r r_1 (cost=0.00..33.20 rows=1,660 width=8) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Index Scan using index_workflow_histories_on_parent_fiber_id on workflow_histories workflow_histories_2 (cost=0.56..759.64 rows=406 width=1,967) (actual rows= loops=)

  • Index Cond: (parent_fiber_id = r_1.fiber_id)