explain.depesz.com

PostgreSQL's explain analyze made readable

Result: he61

Settings
# exclusive inclusive rows x rows loops node
1. 0.333 7.189 ↑ 23.8 12 1

Merge Join (cost=13,053,185.21..13,053,189.08 rows=286 width=1,967) (actual time=7.171..7.189 rows=12 loops=1)

  • Merge Cond: (workflow_histories.id = r.id)
2. 3.266 6.691 ↓ 2.6 1,464 1

Sort (cost=2,243.63..2,245.06 rows=571 width=1,967) (actual time=6.152..6.691 rows=1,464 loops=1)

  • Sort Key: workflow_histories.id
  • Sort Method: quicksort Memory: 2,985kB
3. 3.425 3.425 ↓ 2.6 1,464 1

Index Scan using index_workflow_histories_on_case_file_id on workflow_histories (cost=0.44..2,217.49 rows=571 width=1,967) (actual time=0.090..3.425 rows=1,464 loops=1)

  • Index Cond: (case_file_id = 418,653)
4. 0.019 0.165 ↑ 16.7 12 1

Sort (cost=13,050,941.58..13,050,942.08 rows=200 width=8) (actual time=0.161..0.165 rows=12 loops=1)

  • Sort Key: r.id
  • Sort Method: quicksort Memory: 25kB
5. 0.009 0.146 ↑ 16.7 12 1

HashAggregate (cost=13,050,931.94..13,050,933.94 rows=200 width=8) (actual time=0.146..0.146 rows=12 loops=1)

  • Group Key: r.id
6. 0.137 0.137 ↑ 562,800.5 12 1

CTE Scan on r (cost=12,831,439.74..12,966,511.86 rows=6,753,606 width=8) (actual time=0.040..0.137 rows=12 loops=1)

7.          

CTE r

8. 0.015 0.097 ↑ 562,800.5 12 1

Recursive Union (cost=0.44..12,831,439.74 rows=6,753,606 width=1,967) (actual time=0.036..0.097 rows=12 loops=1)

9. 0.039 0.039 ↑ 13.8 12 1

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 time=0.032..0.039 rows=12 loops=1)

  • Index Cond: (fiber_id = 2,539,741)
10. 0.015 0.043 ↓ 0.0 0 1

Nested Loop (cost=0.56..1,269,614.33 rows=675,344 width=1,967) (actual time=0.043..0.043 rows=0 loops=1)

11. 0.004 0.004 ↑ 138.3 12 1

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

12. 0.024 0.024 ↓ 0.0 0 12

Index Scan using index_workflow_histories_on_parent_fiber_id on workflow_histories workflow_histories_2 (cost=0.56..760.74 rows=407 width=1,967) (actual time=0.002..0.002 rows=0 loops=12)

  • Index Cond: (parent_fiber_id = r_1.fiber_id)
Planning time : 1.587 ms
Execution time : 7.521 ms