explain.depesz.com

PostgreSQL's explain analyze made readable

Result: xQ8l

Settings
# exclusive inclusive rows x rows loops node
1. 0.162 3,029.495 ↓ 38.0 38 1

Sort (cost=1,742.08..1,742.08 rows=1 width=474) (actual time=3,029.482..3,029.495 rows=38 loops=1)

  • Sort Key: s.start_time
  • Sort Method: quicksort Memory: 36kB
2. 1.391 3,029.333 ↓ 38.0 38 1

Nested Loop (cost=10.52..1,742.07 rows=1 width=474) (actual time=20.597..3,029.333 rows=38 loops=1)

  • Join Filter: (ss.caregiver_id = cg.id)
  • Rows Removed by Join Filter: 2166
3. 4.802 3,026.764 ↓ 38.0 38 1

Nested Loop (cost=10.52..1,737.72 rows=1 width=460) (actual time=20.537..3,026.764 rows=38 loops=1)

  • Join Filter: (ss.id = ss_1.id)
  • Rows Removed by Join Filter: 17404
4. 0.103 14.908 ↓ 38.0 38 1

Nested Loop Left Join (cost=9.94..866.86 rows=1 width=370) (actual time=1.108..14.908 rows=38 loops=1)

5. 0.573 14.729 ↓ 38.0 38 1

Nested Loop Left Join (cost=9.79..866.05 rows=1 width=369) (actual time=1.106..14.729 rows=38 loops=1)

  • Join Filter: (checkouts.shift_slot_id = ss.id)
  • Rows Removed by Join Filter: 2004
6. 0.578 13.092 ↓ 38.0 38 1

Nested Loop Left Join (cost=9.79..862.61 rows=1 width=246) (actual time=1.066..13.092 rows=38 loops=1)

  • Join Filter: (checkins.shift_slot_id = ss.id)
  • Rows Removed by Join Filter: 2042
7. 0.093 11.336 ↓ 38.0 38 1

Nested Loop (cost=9.79..859.16 rows=1 width=230) (actual time=1.021..11.336 rows=38 loops=1)

8. 4.725 10.951 ↓ 36.5 73 1

Nested Loop (cost=9.65..858.60 rows=2 width=120) (actual time=0.557..10.951 rows=73 loops=1)

  • Join Filter: (s.id = ss.shift_id)
  • Rows Removed by Join Filter: 18287
9. 0.202 2.106 ↓ 40.0 40 1

Nested Loop (cost=9.65..842.38 rows=1 width=69) (actual time=0.414..2.106 rows=40 loops=1)

  • Join Filter: (frr.resource_type_id = lc.id)
  • Rows Removed by Join Filter: 320
10. 0.111 1.744 ↓ 40.0 40 1

Nested Loop (cost=9.65..841.18 rows=1 width=53) (actual time=0.406..1.744 rows=40 loops=1)

  • Join Filter: (frr.resource_type_id = sstr.resource_type_id)
  • Rows Removed by Join Filter: 80
11. 0.729 1.393 ↓ 120.0 120 1

Hash Join (cost=9.50..840.82 rows=1 width=53) (actual time=0.378..1.393 rows=120 loops=1)

  • Hash Cond: (f.id = s.facility_id)
  • Join Filter: ((timezone(f.timezone, s.start_time) >= '2019-06-22 00:00:00'::timestamp without time zone) AND (timezone(f.timezone, s.start_time) <= '2019-06-28 23:59:59.999'::timestamp without time zone))
  • Rows Removed by Join Filter: 492
12. 0.205 0.499 ↓ 1.0 124 1

Nested Loop (cost=0.29..824.02 rows=121 width=46) (actual time=0.016..0.499 rows=124 loops=1)

13. 0.046 0.046 ↓ 1.0 124 1

Seq Scan on facility_resource_rates frr (cost=0.00..2.21 rows=121 width=21) (actual time=0.007..0.046 rows=124 loops=1)

14. 0.248 0.248 ↑ 1.0 1 124

Index Scan using facilities_pkey on facilities f (cost=0.29..6.78 rows=1 width=25) (actual time=0.002..0.002 rows=1 loops=124)

  • Index Cond: (id = frr.facility_id)
15. 0.074 0.165 ↓ 1.3 204 1

Hash (cost=7.30..7.30 rows=153 width=40) (actual time=0.165..0.165 rows=204 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 23kB
16. 0.091 0.091 ↓ 1.3 204 1

Seq Scan on shifts s (cost=0.00..7.30 rows=153 width=40) (actual time=0.008..0.091 rows=204 loops=1)

  • Filter: (facility_id = ANY ('{333,4839,14400,4148,7898,13953,7897,100}'::bigint[]))
  • Rows Removed by Filter: 68
17. 0.240 0.240 ↑ 1.0 1 120

Index Scan using shift_structures_pkey on shift_structures sstr (cost=0.15..0.35 rows=1 width=16) (actual time=0.001..0.002 rows=1 loops=120)

  • Index Cond: (id = s.shift_structure_id)
18. 0.160 0.160 ↑ 1.0 9 40

Seq Scan on license_certifications lc (cost=0.00..1.09 rows=9 width=40) (actual time=0.001..0.004 rows=9 loops=40)

19. 4.120 4.120 ↓ 1.0 459 40

Seq Scan on shift_slots ss (cost=0.00..10.54 rows=454 width=59) (actual time=0.002..0.103 rows=459 loops=40)

20. 0.292 0.292 ↑ 1.0 1 73

Index Scan using slot_outcomes_pkey on slot_outcomes so (cost=0.15..0.27 rows=1 width=126) (actual time=0.003..0.004 rows=1 loops=73)

  • Index Cond: (id = ss.outcome_id)
  • Filter: ((code)::text = ANY ('{DNR,ARRIVED,WALK_OUT}'::text[]))
21. 1.178 1.178 ↓ 1.4 54 38

Seq Scan on evv_events checkins (cost=0.00..2.96 rows=39 width=24) (actual time=0.004..0.031 rows=54 loops=38)

  • Filter: (event_type = 1)
  • Rows Removed by Filter: 53
22. 1.064 1.064 ↓ 1.4 53 38

Seq Scan on evv_events checkouts (cost=0.00..2.96 rows=38 width=131) (actual time=0.002..0.028 rows=53 loops=38)

  • Filter: (event_type = 2)
  • Rows Removed by Filter: 54
23. 0.076 0.076 ↓ 0.0 0 38

Index Scan using facility_contacts_pkey on facility_contacts fc (cost=0.14..0.79 rows=1 width=17) (actual time=0.001..0.002 rows=0 loops=38)

  • Index Cond: (id = checkouts.supervisor_contact_id)
24. 1,237.090 3,007.054 ↓ 459.0 459 38

Nested Loop (cost=0.58..870.85 rows=1 width=98) (actual time=0.927..79.133 rows=459 loops=38)

  • Join Filter: (s_1.id = ss_1.shift_id)
  • Rows Removed by Join Filter: 124389
25. 37.886 705.356 ↓ 272.0 272 38

Nested Loop (cost=0.58..854.63 rows=1 width=82) (actual time=0.918..18.562 rows=272 loops=38)

  • Join Filter: (frr_1.resource_type_id = sstr_1.resource_type_id)
  • Rows Removed by Join Filter: 539
26. 255.208 636.652 ↓ 270.3 811 38

Nested Loop (cost=0.44..853.71 rows=3 width=98) (actual time=0.915..16.754 rows=811 loops=38)

  • Join Filter: (f_1.id = s_1.facility_id)
  • Rows Removed by Join Filter: 28293
27. 5.092 27.702 ↓ 107.0 107 38

Nested Loop (cost=0.44..845.87 rows=1 width=82) (actual time=0.011..0.729 rows=107 loops=38)

28. 6.726 17.898 ↓ 1.0 124 38

Nested Loop (cost=0.29..824.02 rows=121 width=32) (actual time=0.008..0.471 rows=124 loops=38)

29. 1.748 1.748 ↓ 1.0 124 38

Seq Scan on facility_resource_rates frr_1 (cost=0.00..2.21 rows=121 width=16) (actual time=0.004..0.046 rows=124 loops=38)

30. 9.424 9.424 ↑ 1.0 1 4,712

Index Scan using facilities_pkey on facilities f_1 (cost=0.29..6.78 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=4,712)

  • Index Cond: (id = frr_1.facility_id)
31. 4.712 4.712 ↑ 1.0 1 4,712

Index Scan using facility_billing_break_pkey on facility_billing_break fbb (cost=0.15..0.17 rows=1 width=66) (actual time=0.001..0.001 rows=1 loops=4,712)

  • Index Cond: (id = f_1.billing_break_id)
32. 353.742 353.742 ↓ 1.3 272 4,066

Seq Scan on shifts s_1 (cost=0.00..5.15 rows=215 width=40) (actual time=0.002..0.087 rows=272 loops=4,066)

33. 30.818 30.818 ↑ 1.0 1 30,818

Index Scan using shift_structures_pkey on shift_structures sstr_1 (cost=0.15..0.30 rows=1 width=16) (actual time=0.001..0.001 rows=1 loops=30,818)

  • Index Cond: (id = s_1.shift_structure_id)
34. 1,064.608 1,064.608 ↓ 1.0 459 10,336

Seq Scan on shift_slots ss_1 (cost=0.00..10.54 rows=454 width=32) (actual time=0.002..0.103 rows=459 loops=10,336)

35. 1.178 1.178 ↑ 1.0 58 38

Seq Scan on caregivers cg (cost=0.00..3.58 rows=58 width=22) (actual time=0.004..0.031 rows=58 loops=38)