explain.depesz.com

PostgreSQL's explain analyze made readable

Result: EWce

Settings
# exclusive inclusive rows x rows loops node
1. 2.385 2,887.681 ↓ 2.9 610 1

Sort (cost=71,369.41..71,369.93 rows=207 width=428) (actual time=2,887.490..2,887.681 rows=610 loops=1)

  • Sort Key: l.created_at DESC
  • Sort Method: quicksort Memory: 343kB
2. 8.871 2,885.296 ↓ 2.9 610 1

Nested Loop (cost=278.74..71,361.45 rows=207 width=428) (actual time=2.225..2,885.296 rows=610 loops=1)

  • Join Filter: (l.id = lf.load_id)
3. 2.299 6.447 ↓ 1.3 774 1

Hash Join (cost=278.33..777.23 rows=582 width=77) (actual time=1.540..6.447 rows=774 loops=1)

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

Seq Scan on load_execution_link lel (cost=0.00..442.02 rows=13,615 width=32) (actual time=0.014..3.588 rows=13,781 loops=1)

  • Filter: (status = 11200)
  • Rows Removed by Filter: 162
5. 0.090 0.560 ↓ 1.4 344 1

Hash (cost=275.25..275.25 rows=246 width=45) (actual time=0.560..0.560 rows=344 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 35kB
6. 0.399 0.470 ↓ 1.4 344 1

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

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

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

Index Scan using idx_load_fact_load_id on load_fact lf (cost=0.41..1.66 rows=1 width=238) (actual time=0.006..0.007 rows=1 loops=774)

  • 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. 50.630 50.630 ↑ 1.0 1 610

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

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

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

12. 0.610 34.770 ↓ 0.0 0 610

Limit (cost=0.00..12.78 rows=1 width=1) (actual time=0.057..0.057 rows=0 loops=610)

13. 34.160 34.160 ↓ 0.0 0 610

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

  • 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.220 8.540 ↑ 1.0 1 610

Aggregate (cost=29.80..29.81 rows=1 width=1) (actual time=0.014..0.014 rows=1 loops=610)

15. 7.320 7.320 ↑ 3.1 9 610

Index Scan using idx_event_load_id on event e (cost=0.29..29.73 rows=28 width=0) (actual time=0.007..0.012 rows=9 loops=610)

  • 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.610 2,621.780 ↓ 0.0 0 610

Limit (cost=0.00..14.92 rows=1 width=1) (actual time=4.298..4.298 rows=0 loops=610)

17. 1,159.276 2,621.170 ↓ 0.0 0 610

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

  • Join Filter: (usl.user_id = ull_1.user_id)
  • Rows Removed by Join Filter: 18131
18. 34.160 34.160 ↓ 0.0 0 610

Seq Scan on user_load_link ull_1 (cost=0.00..12.78 rows=1 width=8) (actual time=0.053..0.056 rows=0 loops=610)

  • Filter: ((deassigned_at IS NULL) AND (deassigned_by_user_id IS NULL) AND (load_id = lf.load_id))
  • Rows Removed by Filter: 368
19. 1,427.734 1,427.734 ↑ 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..19.558 rows=151,504 loops=73)

20. 0.610 11.590 ↓ 0.0 0 610

Limit (cost=0.29..42.33 rows=1 width=1) (actual time=0.019..0.019 rows=0 loops=610)

21. 0.970 10.980 ↓ 0.0 0 610

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

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

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=610)

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

Seq Scan on user_load_link ull_2 (cost=0.00..12.78 rows=1 width=16) (actual time=0.037..0.057 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.220 5.490 ↑ 1.0 1 610

Aggregate (cost=8.44..8.46 rows=1 width=1) (actual time=0.009..0.009 rows=1 loops=610)

25. 4.270 4.270 ↑ 1.0 1 610

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

  • 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. 2.440 10.370 ↑ 1.0 1 610

Result (cost=17.02..17.03 rows=1 width=32) (actual time=0.017..0.017 rows=1 loops=610)

27.          

Initplan (for Result)

28. 0.665 7.930 ↓ 2.0 2 610

Nested Loop Left Join (cost=0.83..17.02 rows=1 width=12) (actual time=0.011..0.013 rows=2 loops=610)

29. 3.660 3.660 ↑ 1.0 1 610

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

  • 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. 3.605 3.605 ↑ 1.0 1 721

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.005 rows=1 loops=721)

  • Index Cond: ((s_1.id = parent_id) AND (status = 9002))
31. 0.610 17.690 ↑ 1.0 1 610

Aggregate (cost=22.45..22.46 rows=1 width=1) (actual time=0.029..0.029 rows=1 loops=610)

32. 0.956 17.080 ↑ 1.0 1 610

Nested Loop (cost=9.62..22.45 rows=1 width=0) (actual time=0.022..0.028 rows=1 loops=610)

  • Join Filter: (dl.document_id = a_1.document_id)
33. 0.956 14.030 ↑ 1.0 1 610

Nested Loop (cost=9.34..21.90 rows=1 width=16) (actual time=0.018..0.023 rows=1 loops=610)

34. 2.855 10.980 ↑ 1.0 1 610

Nested Loop (cost=9.06..21.12 rows=1 width=8) (actual time=0.015..0.018 rows=1 loops=610)

35. 1.830 1.830 ↓ 2.0 2 610

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=610)

  • Index Cond: ((parent_type = 1700) AND (lf.load_id = parent_id) AND (status = 2101))
36. 1.259 6.295 ↑ 1.0 1 1,259

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

  • Recheck Cond: (((parent_type = 1728) AND (lel.id = parent_id)) OR ((parent_type = 1705) AND (s_2.id = parent_id)))
  • Heap Blocks: exact=624
37. 1.259 5.036 ↓ 0.0 0 1,259

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

38. 2.518 2.518 ↓ 0.0 0 1,259

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,259)

  • Index Cond: ((parent_type = 1728) AND (lel.id = parent_id))
39. 1.259 1.259 ↓ 0.0 0 1,259

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,259)

  • Index Cond: ((parent_type = 1705) AND (s_2.id = parent_id))
40. 2.094 2.094 ↑ 1.0 1 698

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=698)

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

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

  • Index Cond: (document_id = d.id)
  • Filter: (type = 2601)
  • Rows Removed by Filter: 0
42. 0.000 11.590 ↑ 1.0 1 610

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

43. 0.434 11.590 ↓ 0.0 0 610

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

  • Join Filter: (dl_1.document_id = a_2.document_id)
44. 1.132 9.760 ↑ 1.0 1 610

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

45. 2.323 7.930 ↑ 1.0 1 610

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

46. 1.830 1.830 ↓ 2.0 2 610

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=610)

  • Index Cond: ((parent_type = 1700) AND (lf.load_id = parent_id) AND (status = 2101))
47. 0.000 3.777 ↑ 1.0 1 1,259

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,259)

  • Recheck Cond: (((parent_type = 1728) AND (lel.id = parent_id)) OR ((parent_type = 1705) AND (s_3.id = parent_id)))
  • Heap Blocks: exact=624
48. 1.259 3.777 ↓ 0.0 0 1,259

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

49. 1.259 1.259 ↓ 0.0 0 1,259

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,259)

  • Index Cond: ((parent_type = 1728) AND (lel.id = parent_id))
50. 1.259 1.259 ↓ 0.0 0 1,259

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,259)

  • Index Cond: ((parent_type = 1705) AND (s_3.id = parent_id))
51. 0.698 0.698 ↑ 1.0 1 698

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=698)

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

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=698)

  • Index Cond: (document_id = d_1.id)
  • Filter: (type = 2604)
  • Rows Removed by Filter: 1
53. 0.610 12.200 ↑ 1.0 1 610

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

54. 0.434 11.590 ↓ 0.0 0 610

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

  • Join Filter: (dl_2.document_id = a_3.document_id)
55. 1.132 9.760 ↑ 1.0 1 610

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

56. 2.323 7.930 ↑ 1.0 1 610

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

57. 1.830 1.830 ↓ 2.0 2 610

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.003 rows=2 loops=610)

  • Index Cond: ((parent_type = 1700) AND (lf.load_id = parent_id) AND (status = 2101))
58. 0.000 3.777 ↑ 1.0 1 1,259

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,259)

  • Recheck Cond: (((parent_type = 1728) AND (lel.id = parent_id)) OR ((parent_type = 1705) AND (s_4.id = parent_id)))
  • Heap Blocks: exact=624
59. 1.259 3.777 ↓ 0.0 0 1,259

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

60. 1.259 1.259 ↓ 0.0 0 1,259

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,259)

  • Index Cond: ((parent_type = 1728) AND (lel.id = parent_id))
61. 1.259 1.259 ↓ 0.0 0 1,259

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,259)

  • Index Cond: ((parent_type = 1705) AND (s_4.id = parent_id))
62. 0.698 0.698 ↑ 1.0 1 698

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=698)

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

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=698)

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

Aggregate (cost=8.31..8.32 rows=1 width=4) (actual time=0.006..0.006 rows=1 loops=610)

65. 3.050 3.050 ↑ 1.0 1 610

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.004..0.005 rows=1 loops=610)

  • Index Cond: ((load_id = lf.load_id) AND (shipper_business_id = lf.shipper_business_id))
  • Heap Fetches: 744
66. 0.610 75.640 ↓ 0.0 0 610

Limit (cost=114.69..114.70 rows=1 width=32) (actual time=0.124..0.124 rows=0 loops=610)

67. 1.830 75.030 ↓ 0.0 0 610

Sort (cost=114.69..114.70 rows=1 width=32) (actual time=0.123..0.123 rows=0 loops=610)

  • Sort Key: ((((bu.first_name)::text || ' '::text) || (bu.last_name)::text)) DESC
  • Sort Method: quicksort Memory: 25kB
68. 0.914 73.200 ↓ 0.0 0 610

Nested Loop (cost=0.57..114.68 rows=1 width=32) (actual time=0.083..0.120 rows=0 loops=610)

69. 71.370 71.370 ↓ 0.0 0 610

Index Only Scan using idx_user_representative_user_id_parent_id on user_representative ur (cost=0.28..106.37 rows=1 width=8) (actual time=0.078..0.117 rows=0 loops=610)

  • Index Cond: (parent_id = lel.id)
  • Heap Fetches: 229
70. 0.916 0.916 ↑ 1.0 1 229

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

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