explain.depesz.com

PostgreSQL's explain analyze made readable

Result: czBw

Settings
# exclusive inclusive rows x rows loops node
1. 546.806 982.460 ↓ 157.8 482,905 1

Nested Loop Left Join (cost=491.74..12,378.50 rows=3,060 width=15,145) (actual time=60.339..982.460 rows=482,905 loops=1)

  • Planning time: 12.440 ms
  • Execution time: 1002.467 ms
2. 3.528 92.052 ↓ 34.8 2,121 1

Nested Loop Left Join (cost=486.96..1,485.14 rows=61 width=14,915) (actual time=60.274..92.052 rows=2,121 loops=1)

3. 3.347 82.161 ↓ 34.8 2,121 1

Nested Loop Left Join (cost=486.55..1,450.40 rows=61 width=13,410) (actual time=60.264..82.161 rows=2,121 loops=1)

4. 2.524 72.451 ↓ 34.8 2,121 1

Nested Loop Left Join (cost=486.13..1,415.66 rows=61 width=11,905) (actual time=60.253..72.451 rows=2,121 loops=1)

5. 0.127 66.358 ↓ 43.0 43 1

Nested Loop Left Join (cost=481.22..1,173.02 rows=1 width=11,675) (actual time=60.202..66.358 rows=43 loops=1)

6. 0.134 66.102 ↓ 43.0 43 1

Nested Loop Left Join (cost=480.94..1,172.69 rows=1 width=11,618) (actual time=60.195..66.102 rows=43 loops=1)

7. 0.106 65.624 ↓ 43.0 43 1

Nested Loop Left Join (cost=480.51..1,172.07 rows=1 width=10,640) (actual time=60.181..65.624 rows=43 loops=1)

8. 0.133 65.303 ↓ 43.0 43 1

Nested Loop Left Join (cost=480.09..1,171.61 rows=1 width=9,622) (actual time=60.172..65.303 rows=43 loops=1)

9. 2.771 65.127 ↓ 43.0 43 1

Hash Right Join (cost=479.96..1,170.85 rows=1 width=8,562) (actual time=60.168..65.127 rows=43 loops=1)

  • Hash Cond: (ops_carrier_checklist.carrier_application_id = carrier_applications.id)
10. 2.383 2.383 ↑ 1.0 26,755 1

Seq Scan on ops_carrier_checklist (cost=0.00..590.55 rows=26,755 width=97) (actual time=0.006..2.383 rows=26,755 loops=1)

11. 0.319 59.973 ↓ 43.0 43 1

Hash (cost=479.94..479.94 rows=1 width=8,465) (actual time=59.973..59.973 rows=43 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 54kB
12. 0.225 59.654 ↓ 43.0 43 1

Nested Loop Left Join (cost=10.45..479.94 rows=1 width=8,465) (actual time=2.045..59.654 rows=43 loops=1)

  • Join Filter: (equipment.id = carrier_equipments.equipment_id)
  • Rows Removed by Join Filter: 836
13. 0.067 59.343 ↓ 43.0 43 1

Nested Loop Left Join (cost=10.45..478.49 rows=1 width=7,405) (actual time=2.038..59.343 rows=43 loops=1)

14. 0.052 59.104 ↓ 43.0 43 1

Nested Loop Left Join (cost=10.03..474.30 rows=1 width=5,900) (actual time=2.005..59.104 rows=43 loops=1)

15. 0.046 58.904 ↓ 37.0 37 1

Nested Loop Left Join (cost=9.74..473.99 rows=1 width=5,865) (actual time=1.999..58.904 rows=37 loops=1)

16. 0.107 58.821 ↓ 37.0 37 1

Nested Loop (cost=9.31..465.53 rows=1 width=4,887) (actual time=1.996..58.821 rows=37 loops=1)

17. 0.114 58.492 ↓ 37.0 37 1

Nested Loop Left Join (cost=8.89..457.07 rows=1 width=3,909) (actual time=1.984..58.492 rows=37 loops=1)

18. 0.250 0.250 ↓ 21.0 21 1

Index Scan using carrier_available_trucks_pkey on carrier_available_trucks (cost=0.43..97.83 rows=1 width=292) (actual time=0.066..0.250 rows=21 loops=1)

  • Index Cond: (id = ANY ('{2282327,2282328,2282329,2282330,2282127,2282129,2282130,2282136,2282137,2282163,2282152,2282166,2282167,2282160,2282154,2282148,2282159,2282150,2282164,2282126,2282155}'::integer[]))
  • Filter: ((deleted_at IS NULL) AND (source = ANY ('{manual,carrier_lane_search,inbound_email,dat}'::text[])) AND ((empty_at)::date = '2019-03-12'::date) AND ((empty_at > (now() - '24:00:00'::interval)) OR (source = 'covered_bid'::text)))
19. 31.773 58.128 ↓ 2.0 2 21

Hash Right Join (cost=8.46..359.24 rows=1 width=3,617) (actual time=2.217..2.768 rows=2 loops=21)

  • Hash Cond: (carrier_equipments.carrier_application_id = carrier_applications.id)
20. 26.103 26.103 ↑ 1.0 17,656 21

Seq Scan on carrier_equipments (cost=0.00..284.56 rows=17,656 width=28) (actual time=0.004..1.243 rows=17,656 loops=21)

21. 0.063 0.252 ↑ 1.0 1 21

Hash (cost=8.45..8.45 rows=1 width=3,589) (actual time=0.012..0.012 rows=1 loops=21)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
22. 0.189 0.189 ↑ 1.0 1 21

Index Scan using carrier_applications_pkey on carrier_applications (cost=0.43..8.45 rows=1 width=3,589) (actual time=0.009..0.009 rows=1 loops=21)

  • Index Cond: (id = carrier_available_trucks.carrier_application_id)
23. 0.222 0.222 ↑ 1.0 1 37

Index Scan using locations_pkey on locations (cost=0.43..8.45 rows=1 width=978) (actual time=0.006..0.006 rows=1 loops=37)

  • Index Cond: (id = carrier_available_trucks.truck_location_id)
  • Filter: ((deleted_at IS NULL) AND ((state_code)::text = 'NC'::text))
24. 0.037 0.037 ↓ 0.0 0 37

Index Scan using locations_pkey on locations desired_destination_locations_carrier_available_trucks (cost=0.43..8.45 rows=1 width=978) (actual time=0.001..0.001 rows=0 loops=37)

  • Index Cond: (id = carrier_available_trucks.desired_destination_location_id)
  • Filter: (deleted_at IS NULL)
25. 0.148 0.148 ↑ 1.0 1 37

Index Scan using carrier_manager_relationships_uq_idx on carrier_manager_relationships (cost=0.29..0.30 rows=1 width=35) (actual time=0.003..0.004 rows=1 loops=37)

  • Index Cond: (carrier_application_id = carrier_applications.id)
26. 0.172 0.172 ↑ 1.0 1 43

Index Scan using users_pkey on users (cost=0.42..4.18 rows=1 width=1,505) (actual time=0.003..0.004 rows=1 loops=43)

  • Index Cond: (id = carrier_manager_relationships.user_id)
27. 0.086 0.086 ↑ 1.0 20 43

Seq Scan on equipment (cost=0.00..1.20 rows=20 width=1,060) (actual time=0.001..0.002 rows=20 loops=43)

28. 0.043 0.043 ↓ 0.0 0 43

Index Scan using equipment_pkey on equipment parents_equipment (cost=0.14..0.76 rows=1 width=1,060) (actual time=0.001..0.001 rows=0 loops=43)

  • Index Cond: (id = equipment.parent_id)
29. 0.215 0.215 ↑ 1.0 1 43

Index Scan using index_fmcsa_carriers_on_carrier_application_id on fmcsa_carriers (cost=0.42..0.45 rows=1 width=1,018) (actual time=0.004..0.005 rows=1 loops=43)

  • Index Cond: (carrier_application_id = carrier_applications.id)
30. 0.344 0.344 ↑ 1.0 1 43

Index Scan using index_locations_on_locatable_type_and_locatable_id on locations locations_carrier_applications (cost=0.43..0.60 rows=1 width=978) (actual time=0.008..0.008 rows=1 loops=43)

  • Index Cond: (((locatable_type)::text = 'CarrierApplication'::text) AND (locatable_id = carrier_applications.id))
  • Filter: (deleted_at IS NULL)
31. 0.129 0.129 ↓ 0.0 0 43

Index Scan using coverages_checklist_idx on carrier_insurance_commodities_coverages (cost=0.28..0.32 rows=1 width=57) (actual time=0.003..0.003 rows=0 loops=43)

  • Index Cond: (ops_carrier_checklist_id = ops_carrier_checklist.id)
32. 2.967 3.569 ↑ 1.3 49 43

Bitmap Heap Scan on phone_calls (cost=4.91..242.03 rows=62 width=230) (actual time=0.020..0.083 rows=49 loops=43)

  • Recheck Cond: ((from_phone_number)::text = carrier_available_trucks.contact_phone)
  • Heap Blocks: exact=2025
33. 0.602 0.602 ↑ 1.3 49 43

Bitmap Index Scan on phone_calls_from_phone_number (cost=0.00..4.89 rows=62 width=0) (actual time=0.014..0.014 rows=49 loops=43)

  • Index Cond: ((from_phone_number)::text = carrier_available_trucks.contact_phone)
34. 6.363 6.363 ↑ 1.0 1 2,121

Index Scan using users_pkey on users from_users_phone_calls (cost=0.42..0.56 rows=1 width=1,505) (actual time=0.002..0.003 rows=1 loops=2,121)

  • Index Cond: (id = phone_calls.from_id)
35. 6.363 6.363 ↑ 1.0 1 2,121

Index Scan using users_pkey on users to_users_phone_calls (cost=0.42..0.56 rows=1 width=1,505) (actual time=0.002..0.003 rows=1 loops=2,121)

  • Index Cond: (id = phone_calls.to_id)
36. 288.456 343.602 ↓ 5.1 228 2,121

Bitmap Heap Scan on phone_calls outbound_phone_calls_carrier_available_trucks (cost=4.77..178.13 rows=45 width=230) (actual time=0.044..0.162 rows=228 loops=2,121)

  • Recheck Cond: ((to_phone_number)::text = carrier_available_trucks.contact_phone)
  • Heap Blocks: exact=470697
37. 55.146 55.146 ↓ 5.1 228 2,121

Bitmap Index Scan on phone_calls_to_phone_number (cost=0.00..4.76 rows=45 width=0) (actual time=0.026..0.026 rows=228 loops=2,121)

  • Index Cond: ((to_phone_number)::text = carrier_available_trucks.contact_phone)