explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5X6d

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

Hash Join (cost=41,839,464.68..51,443,998.27 rows=63,632,716 width=123) (actual rows= loops=)

  • Hash Cond: (sw.current_wm_staged_work_status_uid = st.wm_staged_work_status_uid)
2.          

CTE jobs

3. 0.000 0.000 ↓ 0.0

ProjectSet (cost=0.00..0.52 rows=100 width=32) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.01 rows=1 width=0) (actual rows= loops=)

5.          

CTE staged_work

6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4.59..488,923.53 rows=611,912 width=54) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Hash Join (cost=3.90..844.85 rows=100 width=86) (actual rows= loops=)

  • Hash Cond: (wm_job.wm_job_status_uid = wm_job_status.wm_job_status_uid)
8. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2.67..843.25 rows=100 width=75) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

HashAggregate (cost=2.25..3.25 rows=100 width=32) (actual rows= loops=)

  • Group Key: jobs.id
10. 0.000 0.000 ↓ 0.0

CTE Scan on jobs (cost=0.00..2.00 rows=100 width=32) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Index Scan using pk_wm_job on wm_job (cost=0.42..8.40 rows=1 width=43) (actual rows= loops=)

  • Index Cond: ((wm_job_uid)::text = jobs.id)
12. 0.000 0.000 ↓ 0.0

Hash (cost=1.10..1.10 rows=10 width=15) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Seq Scan on wm_job_status (cost=0.00..1.10 rows=10 width=15) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Index Scan using ix_wm_staged_work_job_id on wm_staged_work (cost=0.69..4,819.60 rows=6,119 width=74) (actual rows= loops=)

  • Index Cond: ((job_id)::text = (wm_job.wm_job_uid)::text)
15.          

CTE work_events

16. 0.000 0.000 ↓ 0.0

Append (cost=32,953,618.42..39,421,366.02 rows=60,294,961 width=59) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Hash Join (cost=32,953,618.42..35,889,618.98 rows=57,190,908 width=59) (actual rows= loops=)

  • Hash Cond: ((m.wm_pub_event_work_uid)::text = (e.wm_pub_event_work_uid)::text)
18. 0.000 0.000 ↓ 0.0

Nested Loop (cost=13,776.24..15,496.67 rows=57,190,908 width=81) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

HashAggregate (cost=13,775.67..13,777.67 rows=200 width=90) (actual rows= loops=)

  • Group Key: (staged_work_1.id)::text
20. 0.000 0.000 ↓ 0.0

CTE Scan on staged_work staged_work_1 (cost=0.00..13,768.02 rows=3,060 width=90) (actual rows= loops=)

  • Filter: (bucket = 1)
21. 0.000 0.000 ↓ 0.0

Index Scan using ix_wm_pub_event_work_to_staged_work_map_wm_staged_work_uid on wm_pub_event_work_to_staged_work_map m (cost=0.57..8.59 rows=1 width=81) (actual rows= loops=)

  • Index Cond: ((wm_staged_work_uid)::text = (staged_work_1.id)::text)
22. 0.000 0.000 ↓ 0.0

Hash (cost=30,157,467.08..30,157,467.08 rows=124,962,808 width=52) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Seq Scan on wm_pub_event_work e (cost=0.00..30,157,467.08 rows=124,962,808 width=52) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Hash Join (cost=52,769.50..2,291,226.01 rows=2,981,986 width=59) (actual rows= loops=)

  • Hash Cond: ((e_1.wm_pub_event_work_uid)::text = (m_1.wm_pub_event_work_uid)::text)
25. 0.000 0.000 ↓ 0.0

Seq Scan on wm_pub_event_work e_1 (cost=0.00..2,033,746.79 rows=27,982,379 width=52) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

Hash (cost=15,494.67..15,494.67 rows=2,981,986 width=81) (actual rows= loops=)

27. 0.000 0.000 ↓ 0.0

Nested Loop (cost=13,776.23..15,494.67 rows=2,981,986 width=81) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

HashAggregate (cost=13,775.67..13,777.67 rows=200 width=90) (actual rows= loops=)

  • Group Key: (staged_work_2.id)::text
29. 0.000 0.000 ↓ 0.0

CTE Scan on staged_work staged_work_2 (cost=0.00..13,768.02 rows=3,060 width=90) (actual rows= loops=)

  • Filter: (bucket = 2)
30. 0.000 0.000 ↓ 0.0

Index Scan using ix_wm_pub_event_work_to_staged_work_map_wm_staged_work_uid on wm_pub_event_work_to_staged_work_map m_1 (cost=0.56..8.57 rows=1 width=81) (actual rows= loops=)

  • Index Cond: ((wm_staged_work_uid)::text = (staged_work_2.id)::text)
31. 0.000 0.000 ↓ 0.0

Hash Join (cost=15,331.74..40,055.91 rows=18,201 width=60) (actual rows= loops=)

  • Hash Cond: ((e_2.wm_pub_event_work_uid)::text = (m_2.wm_pub_event_work_uid)::text)
32. 0.000 0.000 ↓ 0.0

Seq Scan on wm_pub_event_work e_2 (cost=0.00..23,612.93 rows=247,793 width=53) (actual rows= loops=)

33. 0.000 0.000 ↓ 0.0

Hash (cost=15,104.23..15,104.23 rows=18,201 width=81) (actual rows= loops=)

34. 0.000 0.000 ↓ 0.0

Hash Join (cost=13,780.17..15,104.23 rows=18,201 width=81) (actual rows= loops=)

  • Hash Cond: ((m_2.wm_staged_work_uid)::text = (staged_work_3.id)::text)
35. 0.000 0.000 ↓ 0.0

Seq Scan on wm_pub_event_work_to_staged_work_map m_2 (cost=0.00..1,026.02 rows=36,402 width=81) (actual rows= loops=)

36. 0.000 0.000 ↓ 0.0

Hash (cost=13,777.67..13,777.67 rows=200 width=90) (actual rows= loops=)

37. 0.000 0.000 ↓ 0.0

HashAggregate (cost=13,775.67..13,777.67 rows=200 width=90) (actual rows= loops=)

  • Group Key: (staged_work_3.id)::text
38. 0.000 0.000 ↓ 0.0

CTE Scan on staged_work staged_work_3 (cost=0.00..13,768.02 rows=3,060 width=90) (actual rows= loops=)

  • Filter: (bucket = 5)
39. 0.000 0.000 ↓ 0.0

Hash Join (cost=16,697.49..296,040.70 rows=103,866 width=60) (actual rows= loops=)

  • Hash Cond: ((e_3.wm_pub_event_work_uid)::text = (m_3.wm_pub_event_work_uid)::text)
40. 0.000 0.000 ↓ 0.0

Seq Scan on wm_pub_event_work e_3 (cost=0.00..270,481.49 rows=2,086,149 width=53) (actual rows= loops=)

41. 0.000 0.000 ↓ 0.0

Hash (cost=15,399.17..15,399.17 rows=103,866 width=81) (actual rows= loops=)

42. 0.000 0.000 ↓ 0.0

Nested Loop (cost=13,776.09..15,399.17 rows=103,866 width=81) (actual rows= loops=)

43. 0.000 0.000 ↓ 0.0

HashAggregate (cost=13,775.67..13,777.67 rows=200 width=90) (actual rows= loops=)

  • Group Key: (staged_work_4.id)::text
44. 0.000 0.000 ↓ 0.0

CTE Scan on staged_work staged_work_4 (cost=0.00..13,768.02 rows=3,060 width=90) (actual rows= loops=)

  • Filter: (bucket = 4)
45. 0.000 0.000 ↓ 0.0

Index Scan using ix_wm_pub_event_work_to_staged_work_map_wm_staged_work_uid on wm_pub_event_work_to_staged_work_map m_3 (cost=0.42..8.10 rows=1 width=81) (actual rows= loops=)

  • Index Cond: ((wm_staged_work_uid)::text = (staged_work_4.id)::text)
46. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=1,929,173.39..11,295,879.70 rows=63,632,716 width=113) (actual rows= loops=)

  • Hash Cond: ((work_events.staged_uid)::text = (sw.wm_staged_work_uid)::text)
47. 0.000 0.000 ↓ 0.0

CTE Scan on work_events (cost=0.00..1,205,899.22 rows=60,294,961 width=90) (actual rows= loops=)

48. 0.000 0.000 ↓ 0.0

Hash (cost=15,220.44..15,220.44 rows=63,632,716 width=113) (actual rows= loops=)

49. 0.000 0.000 ↓ 0.0

Nested Loop (cost=13,768.59..15,220.44 rows=63,632,716 width=113) (actual rows= loops=)

50. 0.000 0.000 ↓ 0.0

HashAggregate (cost=13,768.02..13,770.02 rows=200 width=90) (actual rows= loops=)

  • Group Key: (staged_work.id)::text
51. 0.000 0.000 ↓ 0.0

CTE Scan on staged_work (cost=0.00..12,238.24 rows=611,912 width=90) (actual rows= loops=)

52. 0.000 0.000 ↓ 0.0

Index Scan using pk_wm_staged_work on wm_staged_work sw (cost=0.57..8.59 rows=1 width=113) (actual rows= loops=)

  • Index Cond: ((wm_staged_work_uid)::text = (staged_work.id)::text)
53. 0.000 0.000 ↓ 0.0

Hash (cost=1.10..1.10 rows=10 width=14) (actual rows= loops=)

54. 0.000 0.000 ↓ 0.0

Seq Scan on wm_staged_work_status st (cost=0.00..1.10 rows=10 width=14) (actual rows= loops=)