explain.depesz.com

PostgreSQL's explain analyze made readable

Result: SupJ

Settings
# exclusive inclusive rows x rows loops node
1. 2.842 2,961.795 ↓ 2.9 606 1

Sort (cost=72,142.55..72,143.07 rows=207 width=428) (actual time=2,961.631..2,961.795 rows=606 loops=1)

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

Nested Loop (cost=278.74..72,134.59 rows=207 width=428) (actual time=3.493..2,958.953 rows=606 loops=1)

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

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

  • Hash Cond: (lel.load_id = l.id)
4. 3.800 3.800 ↓ 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.017..3.800 rows=13,777 loops=1)

  • Filter: (status = 11200)
  • Rows Removed by Filter: 162
5. 0.081 0.528 ↓ 1.4 342 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 35kB
6. 0.369 0.447 ↓ 1.4 342 1

Bitmap Heap Scan on load l (cost=6.81..275.25 rows=246 width=45) (actual time=0.104..0.447 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.078 0.078 ↓ 1.4 344 1

Bitmap Index Scan on idx_load_created_at (cost=0.00..6.75 rows=246 width=0) (actual time=0.078..0.078 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.007..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. 46.056 46.056 ↑ 1.0 1 606

Seq Scan on code c (cost=0.00..20.54 rows=1 width=12) (actual time=0.024..0.076 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.090 ↑ 1.0 1 606

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

15. 7.878 7.878 ↑ 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.013 rows=10 loops=606)

  • Index Cond: (lf.load_id = load_id)
  • Filter: ((event_code = 4302) AND ((event_type = 4402) OR (event_type = 4403)))
  • Rows Removed by Filter: 4
16. 0.606 2,440.362 ↓ 0.0 0 606

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

17. 1,063.168 2,439.756 ↓ 0.0 0 606

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

  • Join Filter: (usl.user_id = ull_1.user_id)
  • Rows Removed by Join Filter: 18250
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.048..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,345.682 1,345.682 ↑ 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.434 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. 1.134 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.007..0.008 rows=0 loops=606)

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

Seq Scan on user_load_link ull_2 (cost=0.00..12.78 rows=1 width=16) (actual time=0.033..0.048 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. 0.606 6.060 ↑ 1.0 1 606

Aggregate (cost=8.44..8.46 rows=1 width=1) (actual time=0.010..0.010 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 = 1700) AND (lf.load_id = parent_id) AND (status = 2101))
  • Filter: (appointment_needed IS TRUE)
  • Rows Removed by Filter: 1
26. 3.030 11.514 ↑ 1.0 1 606

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

27.          

Initplan (for Result)

28. 0.570 8.484 ↓ 2.0 2 606

Nested Loop Left Join (cost=0.83..17.02 rows=1 width=12) (actual time=0.012..0.014 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 = 1700) AND (lf.load_id = parent_id))
  • Filter: ((appointment_needed IS TRUE) AND (status = 2101))
  • 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 = 9002))
31. 0.606 19.392 ↑ 1.0 1 606

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

32. 0.852 18.786 ↑ 1.0 1 606

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

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

Nested Loop (cost=9.34..21.90 rows=1 width=16) (actual time=0.020..0.025 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 = 1700) AND (lf.load_id = parent_id) AND (status = 2101))
36. 1.251 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 = 1728) AND (lel.id = parent_id)) OR ((parent_type = 1705) AND (s_2.id = parent_id)))
  • Heap Blocks: exact=622
37. 2.502 6.255 ↓ 0.0 0 1,251

BitmapOr (cost=8.64..8.64 rows=1 width=0) (actual time=0.005..0.005 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 = 1728) AND (lel.id = parent_id))
39. 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 = 1705) AND (s_2.id = parent_id))
40. 2.088 2.088 ↑ 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.003 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 = 2601)
  • Rows Removed by Filter: 0
42. 0.606 11.514 ↑ 1.0 1 606

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

43. 0.000 10.908 ↓ 0.0 0 606

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

  • Join Filter: (dl_1.document_id = a_2.document_id)
44. 1.122 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 = 1700) AND (lf.load_id = parent_id) AND (status = 2101))
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 = 1728) AND (lel.id = parent_id)) OR ((parent_type = 1705) 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 = 1728) 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 = 1705) AND (s_3.id = parent_id))
51. 0.696 0.696 ↑ 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.001 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 = 2604)
  • Rows Removed by Filter: 1
53. 0.606 11.514 ↑ 1.0 1 606

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

54. 0.426 10.908 ↓ 0.0 0 606

Nested Loop (cost=9.62..22.45 rows=1 width=0) (actual time=0.018..0.018 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 = 1700) AND (lf.load_id = parent_id) AND (status = 2101))
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 = 1728) AND (lel.id = parent_id)) OR ((parent_type = 1705) 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 = 1728) 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 = 1705) 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. 0.606 4.242 ↑ 1.0 1 606

Aggregate (cost=8.31..8.32 rows=1 width=4) (actual time=0.007..0.007 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.005..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 329.664 ↓ 0.0 0 606

Limit (cost=118.43..118.43 rows=1 width=32) (actual time=0.544..0.544 rows=0 loops=606)

67. 3.030 329.058 ↓ 0.0 0 606

Sort (cost=118.43..118.43 rows=1 width=32) (actual time=0.543..0.543 rows=0 loops=606)

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

Nested Loop (cost=0.29..118.42 rows=1 width=32) (actual time=0.453..0.538 rows=0 loops=606)

69. 323.604 323.604 ↓ 0.0 0 606

Seq Scan on user_representative ur (cost=0.00..110.10 rows=1 width=8) (actual time=0.443..0.534 rows=0 loops=606)

  • Filter: (parent_id = lel.id)
  • Rows Removed by Filter: 4008
70. 1.135 1.135 ↑ 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.005 rows=1 loops=227)

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