explain.depesz.com

PostgreSQL's explain analyze made readable

Result: lhcd

Settings
# exclusive inclusive rows x rows loops node
1. 0.360 7.157 ↑ 23.8 12 1

Merge Join (cost=13,053,439.54..13,053,443.41 rows=286 width=1,967) (actual time=7.135..7.157 rows=12 loops=1)

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

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

  • Sort Key: workflow_histories.id
  • Sort Method: quicksort Memory: 2985kB
3. 3.383 3.383 ↓ 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.082..3.383 rows=1,464 loops=1)

  • Index Cond: (case_file_id = 418653)
4. 0.012 0.169 ↑ 16.7 12 1

Sort (cost=13,051,195.91..13,051,196.41 rows=200 width=8) (actual time=0.166..0.169 rows=12 loops=1)

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

HashAggregate (cost=13,051,186.27..13,051,188.27 rows=200 width=8) (actual time=0.151..0.157 rows=12 loops=1)

  • Group Key: r.id
6. 0.141 0.141 ↑ 562,951.3 12 1

CTE Scan on r (cost=12,831,635.25..12,966,743.57 rows=6,755,416 width=8) (actual time=0.040..0.141 rows=12 loops=1)

7.          

CTE r

8. 0.009 0.092 ↑ 562,951.3 12 1

Recursive Union (cost=0.44..12,831,635.25 rows=6,755,416 width=1,967) (actual time=0.036..0.092 rows=12 loops=1)

9. 0.040 0.040 ↑ 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.040 rows=12 loops=1)

  • Index Cond: (fiber_id = 2539741)
10. 0.003 0.043 ↓ 0.0 0 1

Nested Loop (cost=0.56..1,269,630.26 rows=675,525 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.036 0.036 ↓ 0.0 0 12

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

  • Index Cond: (parent_fiber_id = r_1.fiber_id)
Planning time : 1.521 ms
Execution time : 7.491 ms