explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FscH

Settings
# exclusive inclusive rows x rows loops node
1. 2.253 2,717.753 ↓ 3.0 612 1

Sort (cost=68,704.39..68,704.90 rows=207 width=428) (actual time=2,717.594..2,717.753 rows=612 loops=1)

  • Sort Key: l.created_at DESC
  • Sort Method: quicksort Memory: 344kB
2. 9.558 2,715.500 ↓ 3.0 612 1

Nested Loop (cost=278.74..68,696.42 rows=207 width=428) (actual time=2.328..2,715.500 rows=612 loops=1)

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

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

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

  • Filter: (status = 11200)
  • Rows Removed by Filter: 164
5. 0.088 0.579 ↓ 1.4 344 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 35kB
6. 0.390 0.491 ↓ 1.4 344 1

Bitmap Heap Scan on load l (cost=6.81..275.25 rows=246 width=45) (actual time=0.126..0.491 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.101 0.101 ↓ 1.4 349 1

Bitmap Index Scan on idx_load_created_at (cost=0.00..6.75 rows=246 width=0) (actual time=0.101..0.101 rows=349 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. 48.348 48.348 ↑ 1.0 1 612

Seq Scan on code c (cost=0.00..20.54 rows=1 width=12) (actual time=0.024..0.079 rows=1 loops=612)

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

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

12. 0.000 1.836 ↓ 0.0 0 612

Limit (cost=0.27..4.29 rows=1 width=1) (actual time=0.003..0.003 rows=0 loops=612)

13. 1.836 1.836 ↓ 0.0 0 612

Index Only Scan using idx_user_load_link_load_id_deassigned_at_deassigned_by_user_id on user_load_link ull (cost=0.27..4.29 rows=1 width=1) (actual time=0.003..0.003 rows=0 loops=612)

  • Index Cond: ((load_id = lf.load_id) AND (deassigned_at IS NULL) AND (deassigned_by_user_id IS NULL))
  • Heap Fetches: 0
14. 0.612 7.956 ↑ 1.0 1 612

Aggregate (cost=29.80..29.81 rows=1 width=1) (actual time=0.013..0.013 rows=1 loops=612)

15. 7.344 7.344 ↑ 2.8 10 612

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=10 loops=612)

  • 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.612 2,494.512 ↓ 0.0 0 612

Limit (cost=0.00..14.99 rows=1 width=1) (actual time=4.076..4.076 rows=0 loops=612)

17. 1,091.709 2,493.900 ↓ 0.0 0 612

Nested Loop (cost=0.00..6,759.23 rows=451 width=1) (actual time=4.075..4.075 rows=0 loops=612)

  • Join Filter: (usl.user_id = ull_1.user_id)
  • Rows Removed by Join Filter: 18072
18. 33.660 33.660 ↓ 0.0 0 612

Seq Scan on user_load_link ull_1 (cost=0.00..13.79 rows=1 width=8) (actual time=0.053..0.055 rows=0 loops=612)

  • 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,368.531 1,368.531 ↑ 1.0 151,508 73

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

20. 0.000 6.120 ↓ 0.0 0 612

Limit (cost=0.56..37.85 rows=1 width=1) (actual time=0.010..0.010 rows=0 loops=612)

21. 0.764 6.120 ↓ 0.0 0 612

Nested Loop (cost=0.56..37.85 rows=1 width=1) (actual time=0.010..0.010 rows=0 loops=612)

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

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

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

Index Scan using idx_user_load_link_load_id_deassigned_at_deassigned_by_user_id on user_load_link ull_2 (cost=0.27..8.29 rows=1 width=16) (actual time=0.005..0.005 rows=1 loops=92)

  • Index Cond: ((load_id = l.id) AND (deassigned_at IS NULL) AND (deassigned_by_user_id IS NULL))
24. 1.224 5.508 ↑ 1.0 1 612

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

25. 4.284 4.284 ↑ 1.0 1 612

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

  • 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. 1.836 9.792 ↑ 1.0 1 612

Result (cost=17.02..17.03 rows=1 width=32) (actual time=0.016..0.016 rows=1 loops=612)

27.          

Initplan (for Result)

28. 1.271 7.956 ↓ 2.0 2 612

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

29. 3.060 3.060 ↑ 1.0 1 612

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

  • 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.625 3.625 ↑ 1.0 1 725

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

  • Index Cond: ((s_1.id = parent_id) AND (status = 9002))
31. 0.612 17.748 ↑ 1.0 1 612

Aggregate (cost=22.46..22.47 rows=1 width=1) (actual time=0.029..0.029 rows=1 loops=612)

32. 0.954 17.136 ↑ 1.0 1 612

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

  • Join Filter: (dl.document_id = a_1.document_id)
33. 0.954 14.076 ↑ 1.0 1 612

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

34. 2.865 11.016 ↑ 1.0 1 612

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

35. 1.836 1.836 ↓ 2.0 2 612

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

  • Index Cond: ((parent_type = 1700) AND (lf.load_id = parent_id) AND (status = 2101))
36. 1.263 6.315 ↑ 1.0 1 1,263

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

  • Recheck Cond: (((parent_type = 1728) AND (lel.id = parent_id)) OR ((parent_type = 1705) AND (s_2.id = parent_id)))
  • Heap Blocks: exact=628
37. 1.263 5.052 ↓ 0.0 0 1,263

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

38. 2.526 2.526 ↓ 0.0 0 1,263

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

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

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

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

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

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

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

  • Index Cond: (document_id = d.id)
  • Filter: (type = 2601)
  • Rows Removed by Filter: 0
42. 0.612 11.628 ↑ 1.0 1 612

Aggregate (cost=22.46..22.47 rows=1 width=1) (actual time=0.019..0.019 rows=1 loops=612)

43. 0.432 11.016 ↓ 0.0 0 612

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

  • Join Filter: (dl_1.document_id = a_2.document_id)
44. 0.522 9.180 ↑ 1.0 1 612

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

45. 2.331 7.956 ↑ 1.0 1 612

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

46. 1.836 1.836 ↓ 2.0 2 612

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

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

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

  • Recheck Cond: (((parent_type = 1728) AND (lel.id = parent_id)) OR ((parent_type = 1705) AND (s_3.id = parent_id)))
  • Heap Blocks: exact=628
48. 1.263 3.789 ↓ 0.0 0 1,263

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

49. 1.263 1.263 ↓ 0.0 0 1,263

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

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

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

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

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

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

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

  • Index Cond: (document_id = d_1.id)
  • Filter: (type = 2604)
  • Rows Removed by Filter: 1
53. 0.000 12.240 ↑ 1.0 1 612

Aggregate (cost=22.46..22.47 rows=1 width=1) (actual time=0.020..0.020 rows=1 loops=612)

54. 1.656 12.240 ↓ 0.0 0 612

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

  • Join Filter: (dl_2.document_id = a_3.document_id)
55. 0.522 9.180 ↑ 1.0 1 612

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

56. 2.943 7.956 ↑ 1.0 1 612

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

57. 1.224 1.224 ↓ 2.0 2 612

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

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

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

  • Recheck Cond: (((parent_type = 1728) AND (lel.id = parent_id)) OR ((parent_type = 1705) AND (s_4.id = parent_id)))
  • Heap Blocks: exact=628
59. 1.263 3.789 ↓ 0.0 0 1,263

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

60. 1.263 1.263 ↓ 0.0 0 1,263

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

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

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

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

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

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

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

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

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

65. 3.060 3.060 ↑ 1.0 1 612

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

  • Index Cond: ((load_id = lf.load_id) AND (shipper_business_id = lf.shipper_business_id))
  • Heap Fetches: 752
66. 0.612 74.664 ↓ 0.0 0 612

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

67. 1.836 74.052 ↓ 0.0 0 612

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

  • Sort Key: ((((bu.first_name)::text || ' '::text) || (bu.last_name)::text)) DESC
  • Sort Method: quicksort Memory: 25kB
68. 0.924 72.216 ↓ 0.0 0 612

Nested Loop (cost=0.57..114.68 rows=1 width=32) (actual time=0.084..0.118 rows=0 loops=612)

69. 70.380 70.380 ↓ 0.0 0 612

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.079..0.115 rows=0 loops=612)

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

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

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