explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Wazl

Settings
# exclusive inclusive rows x rows loops node
1. 2.933 2,993.470 ↓ 2.9 606 1

Sort (cost=72,134.79..72,135.31 rows=207 width=428) (actual time=2,993.318..2,993.470 rows=606 loops=1)

  • Sort Key: l.created_at DESC
  • Sort Method: quicksort Memory: 341kB
2. 10.653 2,990.537 ↓ 2.9 606 1

Nested Loop (cost=278.74..72,126.83 rows=207 width=428) (actual time=4.504..2,990.537 rows=606 loops=1)

  • Join Filter: (l.id = lf.load_id)
3. 2.863 7.796 ↓ 1.3 770 1

Hash Join (cost=278.33..777.23 rows=582 width=77) (actual time=2.542..7.796 rows=770 loops=1)

  • Hash Cond: (lel.load_id = l.id)
4. 4.155 4.155 ↓ 1.0 13,777 1

Seq Scan on load_execution_link lel (cost=0.00..442.02 rows=13,615 width=32) (actual time=0.013..4.155 rows=13,777 loops=1)

  • Filter: (status = 11,200)
  • Rows Removed by Filter: 162
5. 0.138 0.778 ↓ 1.4 342 1

Hash (cost=275.25..275.25 rows=246 width=45) (actual time=0.778..0.778 rows=342 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 35kB
6. 0.542 0.640 ↓ 1.4 342 1

Bitmap Heap Scan on load l (cost=6.81..275.25 rows=246 width=45) (actual time=0.135..0.640 rows=342 loops=1)

  • Recheck Cond: ((created_at >= '2020-03-01 14:30:00+00'::timestamp with time zone) AND (created_at <= now()))
  • Heap Blocks: exact=148
7. 0.098 0.098 ↓ 1.4 344 1

Bitmap Index Scan on idx_load_created_at (cost=0.00..6.75 rows=246 width=0) (actual time=0.098..0.098 rows=344 loops=1)

  • Index Cond: ((created_at >= '2020-03-01 14:30:00+00'::timestamp with time zone) AND (created_at <= now()))
8. 6.930 6.930 ↑ 1.0 1 770

Index Scan using idx_load_fact_load_id on load_fact lf (cost=0.41..1.66 rows=1 width=238) (actual time=0.008..0.009 rows=1 loops=770)

  • Index Cond: (load_id = lel.load_id)
  • Filter: ((lel.shipper_business_id = shipper_business_id) AND ((shipper_business_id = '1703858125129385245'::bigint) OR (carrier_business_id = '1703858125129385245'::bigint)))
  • Rows Removed by Filter: 2
9.          

SubPlan (for Nested Loop)

10. 47.268 47.268 ↑ 1.0 1 606

Seq Scan on code c (cost=0.00..20.54 rows=1 width=12) (actual time=0.025..0.078 rows=1 loops=606)

  • Filter: (l.status = code)
  • Rows Removed by Filter: 762
11. 0.606 0.606 ↑ 1.0 1 606

Result (cost=0.00..0.01 rows=1 width=1) (actual time=0.001..0.001 rows=1 loops=606)

12. 1.212 33.330 ↓ 0.0 0 606

Limit (cost=0.00..12.78 rows=1 width=1) (actual time=0.055..0.055 rows=0 loops=606)

13. 32.118 32.118 ↓ 0.0 0 606

Seq Scan on user_load_link ull (cost=0.00..12.78 rows=1 width=1) (actual time=0.053..0.053 rows=0 loops=606)

  • Filter: ((deassigned_at IS NULL) AND (deassigned_by_user_id IS NULL) AND (load_id = lf.load_id))
  • Rows Removed by Filter: 354
14. 1.212 9.696 ↑ 1.0 1 606

Aggregate (cost=29.80..29.81 rows=1 width=1) (actual time=0.016..0.016 rows=1 loops=606)

15. 8.484 8.484 ↑ 2.8 10 606

Index Scan using idx_event_load_id on event e (cost=0.29..29.73 rows=28 width=0) (actual time=0.009..0.014 rows=10 loops=606)

  • Index Cond: (lf.load_id = load_id)
  • Filter: ((event_code = 4,302) AND ((event_type = 4,402) OR (event_type = 4,403)))
  • Rows Removed by Filter: 4
16. 0.606 2,459.754 ↓ 0.0 0 606

Limit (cost=0.00..14.92 rows=1 width=1) (actual time=4.058..4.059 rows=0 loops=606)

17. 1,061.682 2,459.148 ↓ 0.0 0 606

Nested Loop (cost=0.00..6,758.22 rows=453 width=1) (actual time=4.058..4.058 rows=0 loops=606)

  • Join Filter: (usl.user_id = ull_1.user_id)
  • Rows Removed by Join Filter: 18,250
18. 30.906 30.906 ↓ 0.0 0 606

Seq Scan on user_load_link ull_1 (cost=0.00..12.78 rows=1 width=8) (actual time=0.049..0.051 rows=0 loops=606)

  • Filter: ((deassigned_at IS NULL) AND (deassigned_by_user_id IS NULL) AND (load_id = lf.load_id))
  • Rows Removed by Filter: 367
19. 1,366.560 1,366.560 ↑ 1.0 151,504 73

Seq Scan on user_security_logs usl (cost=0.00..4,821.31 rows=153,931 width=8) (actual time=0.005..18.720 rows=151,504 loops=73)

20. 0.606 10.908 ↓ 0.0 0 606

Limit (cost=0.29..42.33 rows=1 width=1) (actual time=0.018..0.018 rows=0 loops=606)

21. 0.954 10.302 ↓ 0.0 0 606

Nested Loop (cost=0.29..42.33 rows=1 width=1) (actual time=0.017..0.017 rows=0 loops=606)

  • Join Filter: (e_1.created_by_user_id = ull_2.user_id)
  • Rows Removed by Join Filter: 0
22. 4.848 4.848 ↓ 0.0 0 606

Index Scan using idx_event_load_id on event e_1 (cost=0.29..29.54 rows=1 width=16) (actual time=0.008..0.008 rows=0 loops=606)

  • Index Cond: (load_id = l.id)
  • Filter: (event_code = 250)
  • Rows Removed by Filter: 11
23. 4.500 4.500 ↑ 1.0 1 90

Seq Scan on user_load_link ull_2 (cost=0.00..12.78 rows=1 width=16) (actual time=0.035..0.050 rows=1 loops=90)

  • Filter: ((deassigned_at IS NULL) AND (deassigned_by_user_id IS NULL) AND (load_id = l.id))
  • Rows Removed by Filter: 322
24. 1.212 6.666 ↑ 1.0 1 606

Aggregate (cost=8.44..8.46 rows=1 width=1) (actual time=0.010..0.011 rows=1 loops=606)

25. 5.454 5.454 ↑ 1.0 1 606

Index Scan using idx_stop_code_status on stop s (cost=0.42..8.44 rows=1 width=0) (actual time=0.008..0.009 rows=1 loops=606)

  • Index Cond: ((parent_type = 1,700) AND (lf.load_id = parent_id) AND (status = 2,101))
  • Filter: (appointment_needed IS TRUE)
  • Rows Removed by Filter: 1
26. 3.030 12.120 ↑ 1.0 1 606

Result (cost=17.02..17.03 rows=1 width=32) (actual time=0.020..0.020 rows=1 loops=606)

27.          

Initplan (for Result)

28. 1.176 9.090 ↓ 2.0 2 606

Nested Loop Left Join (cost=0.83..17.02 rows=1 width=12) (actual time=0.012..0.015 rows=2 loops=606)

29. 3.636 3.636 ↑ 1.0 1 606

Index Scan using idx_stop_parent_index on stop s_1 (cost=0.42..8.44 rows=1 width=12) (actual time=0.006..0.006 rows=1 loops=606)

  • Index Cond: ((parent_type = 1,700) AND (lf.load_id = parent_id))
  • Filter: ((appointment_needed IS TRUE) AND (status = 2,101))
  • Rows Removed by Filter: 1
30. 4.278 4.278 ↑ 1.0 1 713

Index Scan using idx_appointment_parent_type_parent_id_status on appointment a (cost=0.41..8.56 rows=1 width=16) (actual time=0.005..0.006 rows=1 loops=713)

  • Index Cond: ((s_1.id = parent_id) AND (status = 9,002))
31. 0.606 19.998 ↑ 1.0 1 606

Aggregate (cost=22.45..22.46 rows=1 width=1) (actual time=0.033..0.033 rows=1 loops=606)

32. 0.852 19.392 ↑ 1.0 1 606

Nested Loop (cost=9.62..22.45 rows=1 width=0) (actual time=0.026..0.032 rows=1 loops=606)

  • Join Filter: (dl.document_id = a_1.document_id)
33. 0.852 15.756 ↑ 1.0 1 606

Nested Loop (cost=9.34..21.90 rows=1 width=16) (actual time=0.021..0.026 rows=1 loops=606)

34. 2.796 12.120 ↑ 1.0 1 606

Nested Loop (cost=9.06..21.12 rows=1 width=8) (actual time=0.017..0.020 rows=1 loops=606)

35. 1.818 1.818 ↓ 2.0 2 606

Index Scan using idx_stop_code_status on stop s_2 (cost=0.42..8.44 rows=1 width=8) (actual time=0.002..0.003 rows=2 loops=606)

  • Index Cond: ((parent_type = 1,700) AND (lf.load_id = parent_id) AND (status = 2,101))
36. 2.502 7.506 ↑ 1.0 1 1,251

Bitmap Heap Scan on document_link dl (cost=8.64..12.67 rows=1 width=20) (actual time=0.006..0.006 rows=1 loops=1,251)

  • Recheck Cond: (((parent_type = 1,728) AND (lel.id = parent_id)) OR ((parent_type = 1,705) AND (s_2.id = parent_id)))
  • Heap Blocks: exact=622
37. 0.000 5.004 ↓ 0.0 0 1,251

BitmapOr (cost=8.64..8.64 rows=1 width=0) (actual time=0.004..0.004 rows=0 loops=1,251)

38. 2.502 2.502 ↓ 0.0 0 1,251

Bitmap Index Scan on idx_document_link_parent_type_parent_id (cost=0.00..4.29 rows=1 width=0) (actual time=0.002..0.002 rows=0 loops=1,251)

  • Index Cond: ((parent_type = 1,728) AND (lel.id = parent_id))
39. 2.502 2.502 ↓ 0.0 0 1,251

Bitmap Index Scan on idx_document_link_parent_type_parent_id (cost=0.00..4.29 rows=1 width=0) (actual time=0.002..0.002 rows=0 loops=1,251)

  • Index Cond: ((parent_type = 1,705) AND (s_2.id = parent_id))
40. 2.784 2.784 ↑ 1.0 1 696

Index Only Scan using document_pkey on document d (cost=0.28..0.76 rows=1 width=8) (actual time=0.003..0.004 rows=1 loops=696)

  • Index Cond: (id = dl.document_id)
  • Heap Fetches: 696
41. 2.784 2.784 ↑ 1.0 1 696

Index Scan using idx_attachment_document_id on attachment a_1 (cost=0.28..0.54 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=696)

  • Index Cond: (document_id = d.id)
  • Filter: (type = 2,601)
  • Rows Removed by Filter: 0
42. 0.606 12.120 ↑ 1.0 1 606

Aggregate (cost=22.45..22.46 rows=1 width=1) (actual time=0.020..0.020 rows=1 loops=606)

43. 0.426 11.514 ↓ 0.0 0 606

Nested Loop (cost=9.62..22.45 rows=1 width=0) (actual time=0.019..0.019 rows=0 loops=606)

  • Join Filter: (dl_1.document_id = a_2.document_id)
44. 0.426 9.696 ↑ 1.0 1 606

Nested Loop (cost=9.34..21.90 rows=1 width=16) (actual time=0.012..0.016 rows=1 loops=606)

45. 2.307 7.878 ↑ 1.0 1 606

Nested Loop (cost=9.06..21.12 rows=1 width=8) (actual time=0.010..0.013 rows=1 loops=606)

46. 1.818 1.818 ↓ 2.0 2 606

Index Scan using idx_stop_code_status on stop s_3 (cost=0.42..8.44 rows=1 width=8) (actual time=0.002..0.003 rows=2 loops=606)

  • Index Cond: ((parent_type = 1,700) AND (lf.load_id = parent_id) AND (status = 2,101))
47. 0.000 3.753 ↑ 1.0 1 1,251

Bitmap Heap Scan on document_link dl_1 (cost=8.64..12.67 rows=1 width=20) (actual time=0.003..0.003 rows=1 loops=1,251)

  • Recheck Cond: (((parent_type = 1,728) AND (lel.id = parent_id)) OR ((parent_type = 1,705) AND (s_3.id = parent_id)))
  • Heap Blocks: exact=622
48. 1.251 3.753 ↓ 0.0 0 1,251

BitmapOr (cost=8.64..8.64 rows=1 width=0) (actual time=0.003..0.003 rows=0 loops=1,251)

49. 1.251 1.251 ↓ 0.0 0 1,251

Bitmap Index Scan on idx_document_link_parent_type_parent_id (cost=0.00..4.29 rows=1 width=0) (actual time=0.001..0.001 rows=0 loops=1,251)

  • Index Cond: ((parent_type = 1,728) AND (lel.id = parent_id))
50. 1.251 1.251 ↓ 0.0 0 1,251

Bitmap Index Scan on idx_document_link_parent_type_parent_id (cost=0.00..4.29 rows=1 width=0) (actual time=0.001..0.001 rows=0 loops=1,251)

  • Index Cond: ((parent_type = 1,705) AND (s_3.id = parent_id))
51. 1.392 1.392 ↑ 1.0 1 696

Index Only Scan using document_pkey on document d_1 (cost=0.28..0.76 rows=1 width=8) (actual time=0.001..0.002 rows=1 loops=696)

  • Index Cond: (id = dl_1.document_id)
  • Heap Fetches: 696
52. 1.392 1.392 ↓ 0.0 0 696

Index Scan using idx_attachment_document_id on attachment a_2 (cost=0.28..0.54 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=696)

  • Index Cond: (document_id = d_1.id)
  • Filter: (type = 2,604)
  • Rows Removed by Filter: 1
53. 0.606 12.120 ↑ 1.0 1 606

Aggregate (cost=22.45..22.46 rows=1 width=1) (actual time=0.019..0.020 rows=1 loops=606)

54. 1.032 11.514 ↓ 0.0 0 606

Nested Loop (cost=9.62..22.45 rows=1 width=0) (actual time=0.018..0.019 rows=0 loops=606)

  • Join Filter: (dl_2.document_id = a_3.document_id)
55. 1.122 9.090 ↑ 1.0 1 606

Nested Loop (cost=9.34..21.90 rows=1 width=16) (actual time=0.011..0.015 rows=1 loops=606)

56. 2.307 7.272 ↑ 1.0 1 606

Nested Loop (cost=9.06..21.12 rows=1 width=8) (actual time=0.010..0.012 rows=1 loops=606)

57. 1.212 1.212 ↓ 2.0 2 606

Index Scan using idx_stop_code_status on stop s_4 (cost=0.42..8.44 rows=1 width=8) (actual time=0.002..0.002 rows=2 loops=606)

  • Index Cond: ((parent_type = 1,700) AND (lf.load_id = parent_id) AND (status = 2,101))
58. 0.000 3.753 ↑ 1.0 1 1,251

Bitmap Heap Scan on document_link dl_2 (cost=8.64..12.67 rows=1 width=20) (actual time=0.003..0.003 rows=1 loops=1,251)

  • Recheck Cond: (((parent_type = 1,728) AND (lel.id = parent_id)) OR ((parent_type = 1,705) AND (s_4.id = parent_id)))
  • Heap Blocks: exact=622
59. 1.251 3.753 ↓ 0.0 0 1,251

BitmapOr (cost=8.64..8.64 rows=1 width=0) (actual time=0.003..0.003 rows=0 loops=1,251)

60. 1.251 1.251 ↓ 0.0 0 1,251

Bitmap Index Scan on idx_document_link_parent_type_parent_id (cost=0.00..4.29 rows=1 width=0) (actual time=0.001..0.001 rows=0 loops=1,251)

  • Index Cond: ((parent_type = 1,728) AND (lel.id = parent_id))
61. 1.251 1.251 ↓ 0.0 0 1,251

Bitmap Index Scan on idx_document_link_parent_type_parent_id (cost=0.00..4.29 rows=1 width=0) (actual time=0.001..0.001 rows=0 loops=1,251)

  • Index Cond: ((parent_type = 1,705) AND (s_4.id = parent_id))
62. 0.696 0.696 ↑ 1.0 1 696

Index Only Scan using document_pkey on document d_2 (cost=0.28..0.76 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=696)

  • Index Cond: (id = dl_2.document_id)
  • Heap Fetches: 696
63. 1.392 1.392 ↓ 0.0 0 696

Index Scan using idx_attachment_document_id on attachment a_3 (cost=0.28..0.54 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=696)

  • Index Cond: (document_id = d_2.id)
  • Filter: ((mime_type)::text = ANY ('{image/jpeg,image/png}'::text[]))
  • Rows Removed by Filter: 1
64. 1.212 4.848 ↑ 1.0 1 606

Aggregate (cost=8.31..8.32 rows=1 width=4) (actual time=0.008..0.008 rows=1 loops=606)

65. 3.636 3.636 ↑ 1.0 1 606

Index Only Scan using idx_load_execution_link_load_shipper_carrier_business_status on load_execution_link lel_1 (cost=0.29..8.30 rows=1 width=0) (actual time=0.006..0.006 rows=1 loops=606)

  • Index Cond: ((load_id = lf.load_id) AND (shipper_business_id = lf.shipper_business_id))
  • Heap Fetches: 740
66. 0.606 335.724 ↓ 0.0 0 606

Limit (cost=118.39..118.39 rows=1 width=32) (actual time=0.554..0.554 rows=0 loops=606)

67. 3.030 335.118 ↓ 0.0 0 606

Sort (cost=118.39..118.39 rows=1 width=32) (actual time=0.553..0.553 rows=0 loops=606)

  • Sort Key: ((((bu.first_name)::text || ' '::text) || (bu.last_name)::text)) DESC
  • Sort Method: quicksort Memory: 25kB
68. 1.668 332.088 ↓ 0.0 0 606

Nested Loop (cost=0.29..118.38 rows=1 width=32) (actual time=0.461..0.548 rows=0 loops=606)

69. 329.058 329.058 ↓ 0.0 0 606

Seq Scan on user_representative ur (cost=0.00..110.06 rows=1 width=8) (actual time=0.451..0.543 rows=0 loops=606)

  • Filter: (parent_id = lel.id)
  • Rows Removed by Filter: 4,006
70. 1.362 1.362 ↑ 1.0 1 227

Index Scan using idx_business_user_id_status on business_user bu (cost=0.29..8.30 rows=1 width=21) (actual time=0.005..0.006 rows=1 loops=227)

  • Index Cond: (id = ur.user_id)
Planning time : 10.755 ms
Execution time : 2,994.555 ms