explain.depesz.com

PostgreSQL's explain analyze made readable

Result: F699 : appointment search everything using trailer subqueries, commenting out trailer filter, filter_value='hi'

Settings
# exclusive inclusive rows x rows loops node
1. 7.004 35,733.373 ↑ 1.0 10 1

Limit (cost=451,176.75..451,176.77 rows=10 width=368) (actual time=35,730.054..35,733.373 rows=10 loops=1)

2. 13.894 35,726.369 ↑ 923.4 510 1

Sort (cost=451,175.50..452,352.81 rows=470,927 width=368) (actual time=35,721.978..35,726.369 rows=510 loops=1)

  • Sort Key: appointments.id DESC
  • Sort Method: top-N heapsort Memory: 296kB
3. 20.551 35,712.475 ↑ 459.9 1,024 1

Unique (cost=397,032.19..422,933.17 rows=470,927 width=368) (actual time=35,680.579..35,712.475 rows=1,024 loops=1)

4. 38.447 35,691.924 ↑ 341.0 1,381 1

Sort (cost=397,032.19..398,209.50 rows=470,927 width=368) (actual time=35,680.563..35,691.924 rows=1,381 loops=1)

  • Sort Key: appointments.id, appointments.appointment_type, appointments.update_time, appointments.tms_id, appointments.tms_source, appointments.site_id, appointments.tractor_id, appointments.gate_pass_number, appointments.gp_open_time, appointments.gp_close_time, appointments.gp_expiration, appointments.gp_close_type, tractors.name, tractors.tractor_state, tractors.tractor_country, tractors.license_plate, tractors.carrier_id, carriers.name, carriers.carrier_code, trailers.name, trailers_1.name
  • Sort Method: quicksort Memory: 415kB
5. 36.884 35,653.477 ↑ 341.0 1,381 1

Append (cost=318.28..194,913.75 rows=470,927 width=368) (actual time=264.415..35,653.477 rows=1,381 loops=1)

6. 0.158 264.621 ↑ 1.6 8 1

Unique (cost=318.28..318.96 rows=13 width=253) (actual time=264.401..264.621 rows=8 loops=1)

7. 0.322 264.463 ↑ 1.1 12 1

Sort (cost=318.28..318.31 rows=13 width=253) (actual time=264.376..264.463 rows=12 loops=1)

  • Sort Key: appointments.id, appointments.appointment_type, appointments.update_time, appointments.tms_id, appointments.tms_source, appointments.tractor_id, appointments.gate_pass_number, appointments.gp_open_time, appointments.gp_close_time, appointments.gp_expiration, appointments.gp_close_type, tractors.name, tractors.tractor_state, tractors.tractor_country, tractors.license_plate, tractors.carrier_id, carriers.name, carriers.carrier_code, trailers.name, trailers_1.name
  • Sort Method: quicksort Memory: 28kB
8. 0.267 264.141 ↑ 1.1 12 1

Hash Left Join (cost=294.86..318.04 rows=13 width=253) (actual time=253.103..264.141 rows=12 loops=1)

  • Hash Cond: (tractors.carrier_id = carriers.id)
9. 0.322 263.489 ↑ 1.1 12 1

Nested Loop Left Join (cost=293.25..316.39 rows=13 width=189) (actual time=252.671..263.489 rows=12 loops=1)

10. 5.370 263.023 ↑ 1.1 12 1

Hash Right Join (cost=292.97..309.38 rows=13 width=148) (actual time=252.597..263.023 rows=12 loops=1)

  • Hash Cond: (appointments_1.id = appointments.id)
11. 10.871 79.519 ↑ 1.0 687 1

HashAggregate (cost=106.57..113.44 rows=687 width=24) (actual time=74.194..79.519 rows=687 loops=1)

  • Group Key: appointments_1.id, trailers.name
12. 9.933 68.648 ↑ 1.0 687 1

Hash Join (cost=71.42..103.14 rows=687 width=24) (actual time=42.671..68.648 rows=687 loops=1)

  • Hash Cond: (assignments_1.trailer_id = trailers.id)
13. 11.174 36.749 ↑ 1.0 687 1

Hash Join (cost=33.09..62.99 rows=687 width=8) (actual time=20.667..36.749 rows=687 loops=1)

  • Hash Cond: (assignments_1.appointment_id = appointments_1.id)
14. 5.113 5.113 ↑ 1.0 687 1

Seq Scan on assignments assignments_1 (cost=0.00..28.09 rows=687 width=8) (actual time=0.018..5.113 rows=687 loops=1)

  • Filter: (direction = 'Inbound'::trailerdirection)
  • Rows Removed by Filter: 680
15. 10.556 20.462 ↑ 1.0 1,026 1

Hash (cost=20.26..20.26 rows=1,026 width=4) (actual time=20.450..20.462 rows=1,026 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 53kB
16. 9.906 9.906 ↑ 1.0 1,026 1

Seq Scan on appointments appointments_1 (cost=0.00..20.26 rows=1,026 width=4) (actual time=0.022..9.906 rows=1,026 loops=1)

17. 10.828 21.966 ↑ 1.0 1,126 1

Hash (cost=24.26..24.26 rows=1,126 width=24) (actual time=21.953..21.966 rows=1,126 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 79kB
18. 11.138 11.138 ↑ 1.0 1,126 1

Seq Scan on trailers (cost=0.00..24.26 rows=1,126 width=24) (actual time=0.135..11.138 rows=1,126 loops=1)

19. 0.176 178.134 ↑ 1.1 12 1

Hash (cost=186.24..186.24 rows=13 width=128) (actual time=178.121..178.134 rows=12 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
20. 6.589 177.958 ↑ 1.1 12 1

Hash Right Join (cost=170.00..186.24 rows=13 width=128) (actual time=165.970..177.958 rows=12 loops=1)

  • Hash Cond: (appointments_2.id = appointments.id)
21. 21.350 144.696 ↑ 1.0 680 1

HashAggregate (cost=106.50..113.30 rows=680 width=24) (actual time=138.116..144.696 rows=680 loops=1)

  • Group Key: appointments_2.id, trailers_1.name
22. 26.985 123.346 ↑ 1.0 680 1

Hash Join (cost=71.42..103.10 rows=680 width=24) (actual time=57.773..123.346 rows=680 loops=1)

  • Hash Cond: (assignments_2.trailer_id = trailers_1.id)
23. 24.690 73.343 ↑ 1.0 680 1

Hash Join (cost=33.09..62.97 rows=680 width=8) (actual time=34.705..73.343 rows=680 loops=1)

  • Hash Cond: (assignments_2.appointment_id = appointments_2.id)
24. 14.003 14.003 ↑ 1.0 680 1

Seq Scan on assignments assignments_2 (cost=0.00..28.09 rows=680 width=8) (actual time=0.020..14.003 rows=680 loops=1)

  • Filter: (direction = 'Outbound'::trailerdirection)
  • Rows Removed by Filter: 687
25. 17.837 34.650 ↑ 1.0 1,026 1

Hash (cost=20.26..20.26 rows=1,026 width=4) (actual time=34.637..34.650 rows=1,026 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 53kB
26. 16.813 16.813 ↑ 1.0 1,026 1

Seq Scan on appointments appointments_2 (cost=0.00..20.26 rows=1,026 width=4) (actual time=0.013..16.813 rows=1,026 loops=1)

27. 11.840 23.018 ↑ 1.0 1,126 1

Hash (cost=24.26..24.26 rows=1,126 width=24) (actual time=23.006..23.018 rows=1,126 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 79kB
28. 11.178 11.178 ↑ 1.0 1,126 1

Seq Scan on trailers trailers_1 (cost=0.00..24.26 rows=1,126 width=24) (actual time=0.029..11.178 rows=1,126 loops=1)

29. 0.111 26.673 ↑ 1.1 12 1

Hash (cost=63.34..63.34 rows=13 width=108) (actual time=26.661..26.673 rows=12 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
30. 0.426 26.562 ↑ 1.1 12 1

Nested Loop (cost=34.77..63.34 rows=13 width=108) (actual time=4.603..26.562 rows=12 loops=1)

31. 0.352 25.908 ↑ 1.1 12 1

Nested Loop (cost=34.49..58.90 rows=13 width=4) (actual time=4.563..25.908 rows=12 loops=1)

32. 11.362 25.268 ↑ 1.1 12 1

Hash Join (cost=34.21..54.20 rows=13 width=4) (actual time=4.497..25.268 rows=12 loops=1)

  • Hash Cond: (assignment_deliveries.delivery_id = deliveries.id)
33. 11.428 11.428 ↑ 1.0 1,028 1

Seq Scan on assignment_deliveries (cost=0.00..17.28 rows=1,028 width=8) (actual time=0.073..11.428 rows=1,028 loops=1)

34. 0.146 2.478 ↑ 1.2 12 1

Hash (cost=34.04..34.04 rows=14 width=4) (actual time=2.465..2.478 rows=12 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
35. 2.332 2.332 ↑ 1.2 12 1

Seq Scan on deliveries (cost=0.00..34.04 rows=14 width=4) (actual time=0.492..2.332 rows=12 loops=1)

  • Filter: ((name)::text ~~* '%%hi%%'::text)
  • Rows Removed by Filter: 1111
36. 0.288 0.288 ↑ 1.0 1 12

Index Scan using assignments_pkey on assignments (cost=0.28..0.36 rows=1 width=8) (actual time=0.023..0.024 rows=1 loops=12)

  • Index Cond: (id = assignment_deliveries.assignment_id)
37. 0.228 0.228 ↑ 1.0 1 12

Index Scan using appointments_pkey on appointments (cost=0.28..0.34 rows=1 width=108) (actual time=0.018..0.019 rows=1 loops=12)

  • Index Cond: (id = assignments.appointment_id)
  • Filter: ((gp_open_time IS NOT NULL) AND (site_id = 1))
38. 0.144 0.144 ↑ 1.0 1 12

Index Scan using tractors_pkey on tractors (cost=0.28..0.54 rows=1 width=45) (actual time=0.011..0.012 rows=1 loops=12)

  • Index Cond: (appointments.tractor_id = id)
39. 0.193 0.385 ↑ 1.0 27 1

Hash (cost=1.27..1.27 rows=27 width=68) (actual time=0.373..0.385 rows=27 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
40. 0.192 0.192 ↑ 1.0 27 1

Seq Scan on carriers (cost=0.00..1.27 rows=27 width=68) (actual time=0.013..0.192 rows=27 loops=1)

41. 0.137 174.437 ↑ 1.6 8 1

Unique (cost=318.28..318.96 rows=13 width=253) (actual time=174.231..174.437 rows=8 loops=1)

42. 0.228 174.300 ↑ 1.1 12 1

Sort (cost=318.28..318.31 rows=13 width=253) (actual time=174.217..174.300 rows=12 loops=1)

  • Sort Key: appointments_3.id, appointments_3.appointment_type, appointments_3.update_time, appointments_3.tms_id, appointments_3.tms_source, appointments_3.tractor_id, appointments_3.gate_pass_number, appointments_3.gp_open_time, appointments_3.gp_close_time, appointments_3.gp_expiration, appointments_3.gp_close_type, tractors_1.name, tractors_1.tractor_state, tractors_1.tractor_country, tractors_1.license_plate, tractors_1.carrier_id, carriers_1.name, carriers_1.carrier_code, trailers_2.name, trailers_3.name
  • Sort Method: quicksort Memory: 28kB
43. 0.181 174.072 ↑ 1.1 12 1

Hash Left Join (cost=294.86..318.04 rows=13 width=253) (actual time=163.285..174.072 rows=12 loops=1)

  • Hash Cond: (tractors_1.carrier_id = carriers_1.id)
44. 0.298 173.486 ↑ 1.1 12 1

Nested Loop Left Join (cost=293.25..316.39 rows=13 width=189) (actual time=162.860..173.486 rows=12 loops=1)

45. 5.083 173.008 ↑ 1.1 12 1

Hash Right Join (cost=292.97..309.38 rows=13 width=148) (actual time=162.795..173.008 rows=12 loops=1)

  • Hash Cond: (appointments_4.id = appointments_3.id)
46. 12.639 75.978 ↑ 1.0 687 1

HashAggregate (cost=106.57..113.44 rows=687 width=24) (actual time=70.503..75.978 rows=687 loops=1)

  • Group Key: appointments_4.id, trailers_2.name
47. 11.960 63.339 ↑ 1.0 687 1

Hash Join (cost=71.42..103.14 rows=687 width=24) (actual time=33.236..63.339 rows=687 loops=1)

  • Hash Cond: (assignments_4.trailer_id = trailers_2.id)
48. 12.222 33.344 ↑ 1.0 687 1

Hash Join (cost=33.09..62.99 rows=687 width=8) (actual time=15.169..33.344 rows=687 loops=1)

  • Hash Cond: (assignments_4.appointment_id = appointments_4.id)
49. 6.002 6.002 ↑ 1.0 687 1

Seq Scan on assignments assignments_4 (cost=0.00..28.09 rows=687 width=8) (actual time=0.019..6.002 rows=687 loops=1)

  • Filter: (direction = 'Inbound'::trailerdirection)
  • Rows Removed by Filter: 680
50. 7.699 15.120 ↑ 1.0 1,026 1

Hash (cost=20.26..20.26 rows=1,026 width=4) (actual time=15.108..15.120 rows=1,026 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 53kB
51. 7.421 7.421 ↑ 1.0 1,026 1

Seq Scan on appointments appointments_4 (cost=0.00..20.26 rows=1,026 width=4) (actual time=0.013..7.421 rows=1,026 loops=1)

52. 9.070 18.035 ↑ 1.0 1,126 1

Hash (cost=24.26..24.26 rows=1,126 width=24) (actual time=18.023..18.035 rows=1,126 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 79kB
53. 8.965 8.965 ↑ 1.0 1,126 1

Seq Scan on trailers trailers_2 (cost=0.00..24.26 rows=1,126 width=24) (actual time=0.020..8.965 rows=1,126 loops=1)

54. 0.137 91.947 ↑ 1.1 12 1

Hash (cost=186.24..186.24 rows=13 width=128) (actual time=91.935..91.947 rows=12 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
55. 5.621 91.810 ↑ 1.1 12 1

Hash Right Join (cost=170.00..186.24 rows=13 width=128) (actual time=81.326..91.810 rows=12 loops=1)

  • Hash Cond: (appointments_5.id = appointments_3.id)
56. 11.694 69.869 ↑ 1.0 680 1

HashAggregate (cost=106.50..113.30 rows=680 width=24) (actual time=64.280..69.869 rows=680 loops=1)

  • Group Key: appointments_5.id, trailers_3.name
57. 10.946 58.175 ↑ 1.0 680 1

Hash Join (cost=71.42..103.10 rows=680 width=24) (actual time=31.809..58.175 rows=680 loops=1)

  • Hash Cond: (assignments_5.trailer_id = trailers_3.id)
58. 10.275 30.351 ↑ 1.0 680 1

Hash Join (cost=33.09..62.97 rows=680 width=8) (actual time=14.901..30.351 rows=680 loops=1)

  • Hash Cond: (assignments_5.appointment_id = appointments_5.id)
59. 5.221 5.221 ↑ 1.0 680 1

Seq Scan on assignments assignments_5 (cost=0.00..28.09 rows=680 width=8) (actual time=0.018..5.221 rows=680 loops=1)

  • Filter: (direction = 'Outbound'::trailerdirection)
  • Rows Removed by Filter: 687
60. 7.634 14.855 ↑ 1.0 1,026 1

Hash (cost=20.26..20.26 rows=1,026 width=4) (actual time=14.843..14.855 rows=1,026 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 53kB
61. 7.221 7.221 ↑ 1.0 1,026 1

Seq Scan on appointments appointments_5 (cost=0.00..20.26 rows=1,026 width=4) (actual time=0.013..7.221 rows=1,026 loops=1)

62. 8.545 16.878 ↑ 1.0 1,126 1

Hash (cost=24.26..24.26 rows=1,126 width=24) (actual time=16.866..16.878 rows=1,126 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 79kB
63. 8.333 8.333 ↑ 1.0 1,126 1

Seq Scan on trailers trailers_3 (cost=0.00..24.26 rows=1,126 width=24) (actual time=0.012..8.333 rows=1,126 loops=1)

64. 0.185 16.320 ↑ 1.1 12 1

Hash (cost=63.34..63.34 rows=13 width=108) (actual time=16.291..16.320 rows=12 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
65. 0.232 16.135 ↑ 1.1 12 1

Nested Loop (cost=34.77..63.34 rows=13 width=108) (actual time=3.037..16.135 rows=12 loops=1)

66. 0.329 15.759 ↑ 1.1 12 1

Nested Loop (cost=34.49..58.90 rows=13 width=4) (actual time=3.001..15.759 rows=12 loops=1)

67. 7.371 15.286 ↑ 1.1 12 1

Hash Join (cost=34.21..54.20 rows=13 width=4) (actual time=2.958..15.286 rows=12 loops=1)

  • Hash Cond: (assignment_deliveries_1.delivery_id = deliveries_1.id)
68. 6.903 6.903 ↑ 1.0 1,028 1

Seq Scan on assignment_deliveries assignment_deliveries_1 (cost=0.00..17.28 rows=1,028 width=8) (actual time=0.017..6.903 rows=1,028 loops=1)

69. 0.095 1.012 ↑ 1.2 12 1

Hash (cost=34.04..34.04 rows=14 width=4) (actual time=1.000..1.012 rows=12 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
70. 0.917 0.917 ↑ 1.2 12 1

Seq Scan on deliveries deliveries_1 (cost=0.00..34.04 rows=14 width=4) (actual time=0.112..0.917 rows=12 loops=1)

  • Filter: ((route_id)::text ~~* '%%hi%%'::text)
  • Rows Removed by Filter: 1111
71. 0.144 0.144 ↑ 1.0 1 12

Index Scan using assignments_pkey on assignments assignments_3 (cost=0.28..0.36 rows=1 width=8) (actual time=0.011..0.012 rows=1 loops=12)

  • Index Cond: (id = assignment_deliveries_1.assignment_id)
72. 0.144 0.144 ↑ 1.0 1 12

Index Scan using appointments_pkey on appointments appointments_3 (cost=0.28..0.34 rows=1 width=108) (actual time=0.011..0.012 rows=1 loops=12)

  • Index Cond: (id = assignments_3.appointment_id)
  • Filter: ((gp_open_time IS NOT NULL) AND (site_id = 1))
73. 0.180 0.180 ↑ 1.0 1 12

Index Scan using tractors_pkey on tractors tractors_1 (cost=0.28..0.54 rows=1 width=45) (actual time=0.014..0.015 rows=1 loops=12)

  • Index Cond: (appointments_3.tractor_id = id)
74. 0.202 0.405 ↑ 1.0 27 1

Hash (cost=1.27..1.27 rows=27 width=68) (actual time=0.388..0.405 rows=27 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
75. 0.203 0.203 ↑ 1.0 27 1

Seq Scan on carriers carriers_1 (cost=0.00..1.27 rows=27 width=68) (actual time=0.014..0.203 rows=27 loops=1)

76. 0.012 0.392 ↓ 0.0 0 1

Unique (cost=289.34..289.39 rows=1 width=253) (actual time=0.379..0.392 rows=0 loops=1)

77. 0.049 0.380 ↓ 0.0 0 1

Sort (cost=289.34..289.34 rows=1 width=253) (actual time=0.367..0.380 rows=0 loops=1)

  • Sort Key: appointments_6.id, appointments_6.appointment_type, appointments_6.update_time, appointments_6.tms_id, appointments_6.tms_source, appointments_6.tractor_id, appointments_6.gate_pass_number, appointments_6.gp_open_time, appointments_6.gp_close_time, appointments_6.gp_expiration, appointments_6.gp_close_type, tractors_2.name, tractors_2.tractor_state, tractors_2.tractor_country, tractors_2.license_plate, tractors_2.carrier_id, carriers_2.name, carriers_2.carrier_code, trailers_4.name, trailers_5.name
  • Sort Method: quicksort Memory: 25kB
78. 0.013 0.331 ↓ 0.0 0 1

Nested Loop Left Join (cost=272.72..289.33 rows=1 width=253) (actual time=0.318..0.331 rows=0 loops=1)

79. 0.011 0.318 ↓ 0.0 0 1

Nested Loop Left Join (cost=272.58..289.17 rows=1 width=189) (actual time=0.305..0.318 rows=0 loops=1)

80. 0.020 0.307 ↓ 0.0 0 1

Hash Right Join (cost=272.30..288.63 rows=1 width=148) (actual time=0.294..0.307 rows=0 loops=1)

  • Hash Cond: (appointments_7.id = appointments_6.id)
81. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=106.57..113.44 rows=687 width=24) (never executed)

  • Group Key: appointments_7.id, trailers_4.name
82. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=71.42..103.14 rows=687 width=24) (never executed)

  • Hash Cond: (assignments_7.trailer_id = trailers_4.id)
83. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=33.09..62.99 rows=687 width=8) (never executed)

  • Hash Cond: (assignments_7.appointment_id = appointments_7.id)
84. 0.000 0.000 ↓ 0.0 0

Seq Scan on assignments assignments_7 (cost=0.00..28.09 rows=687 width=8) (never executed)

  • Filter: (direction = 'Inbound'::trailerdirection)
85. 0.000 0.000 ↓ 0.0 0

Hash (cost=20.26..20.26 rows=1,026 width=4) (never executed)

86. 0.000 0.000 ↓ 0.0 0

Seq Scan on appointments appointments_7 (cost=0.00..20.26 rows=1,026 width=4) (never executed)

87. 0.000 0.000 ↓ 0.0 0

Hash (cost=24.26..24.26 rows=1,126 width=24) (never executed)

88. 0.000 0.000 ↓ 0.0 0

Seq Scan on trailers trailers_4 (cost=0.00..24.26 rows=1,126 width=24) (never executed)

89. 0.015 0.287 ↓ 0.0 0 1

Hash (cost=165.72..165.72 rows=1 width=128) (actual time=0.272..0.287 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
90. 0.020 0.272 ↓ 0.0 0 1

Hash Right Join (cost=149.56..165.72 rows=1 width=128) (actual time=0.260..0.272 rows=0 loops=1)

  • Hash Cond: (appointments_8.id = appointments_6.id)
91. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=106.50..113.30 rows=680 width=24) (never executed)

  • Group Key: appointments_8.id, trailers_5.name
92. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=71.42..103.10 rows=680 width=24) (never executed)

  • Hash Cond: (assignments_8.trailer_id = trailers_5.id)
93. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=33.09..62.97 rows=680 width=8) (never executed)

  • Hash Cond: (assignments_8.appointment_id = appointments_8.id)
94. 0.000 0.000 ↓ 0.0 0

Seq Scan on assignments assignments_8 (cost=0.00..28.09 rows=680 width=8) (never executed)

  • Filter: (direction = 'Outbound'::trailerdirection)
95. 0.000 0.000 ↓ 0.0 0

Hash (cost=20.26..20.26 rows=1,026 width=4) (never executed)

96. 0.000 0.000 ↓ 0.0 0

Seq Scan on appointments appointments_8 (cost=0.00..20.26 rows=1,026 width=4) (never executed)

97. 0.000 0.000 ↓ 0.0 0

Hash (cost=24.26..24.26 rows=1,126 width=24) (never executed)

98. 0.000 0.000 ↓ 0.0 0

Seq Scan on trailers trailers_5 (cost=0.00..24.26 rows=1,126 width=24) (never executed)

99. 0.011 0.252 ↓ 0.0 0 1

Hash (cost=43.05..43.05 rows=1 width=108) (actual time=0.240..0.252 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
100. 0.012 0.241 ↓ 0.0 0 1

Nested Loop (cost=0.83..43.05 rows=1 width=108) (actual time=0.229..0.241 rows=0 loops=1)

101. 0.012 0.229 ↓ 0.0 0 1

Nested Loop (cost=0.56..42.70 rows=1 width=4) (actual time=0.217..0.229 rows=0 loops=1)

102. 0.012 0.217 ↓ 0.0 0 1

Nested Loop (cost=0.28..42.34 rows=1 width=4) (actual time=0.205..0.217 rows=0 loops=1)

103. 0.205 0.205 ↓ 0.0 0 1

Seq Scan on deliveries deliveries_2 (cost=0.00..34.04 rows=1 width=4) (actual time=0.193..0.205 rows=0 loops=1)

  • Filter: ((bill_of_lading)::text ~~* '%%hi%%'::text)
  • Rows Removed by Filter: 1123
104. 0.000 0.000 ↓ 0.0 0

Index Scan using assignment_delivery_delivery_id_idx on assignment_deliveries assignment_deliveries_2 (cost=0.28..8.29 rows=1 width=8) (never executed)

  • Index Cond: (delivery_id = deliveries_2.id)
105. 0.000 0.000 ↓ 0.0 0

Index Scan using assignments_pkey on assignments assignments_6 (cost=0.28..0.36 rows=1 width=8) (never executed)

  • Index Cond: (id = assignment_deliveries_2.assignment_id)
106. 0.000 0.000 ↓ 0.0 0

Index Scan using appointments_pkey on appointments appointments_6 (cost=0.28..0.34 rows=1 width=108) (never executed)

  • Index Cond: (id = assignments_6.appointment_id)
  • Filter: ((gp_open_time IS NOT NULL) AND (site_id = 1))
107. 0.000 0.000 ↓ 0.0 0

Index Scan using tractors_pkey on tractors tractors_2 (cost=0.28..0.54 rows=1 width=45) (never executed)

  • Index Cond: (appointments_6.tractor_id = id)
108. 0.000 0.000 ↓ 0.0 0

Index Scan using carriers_pkey on carriers carriers_2 (cost=0.14..0.16 rows=1 width=68) (never executed)

  • Index Cond: (tractors_2.carrier_id = id)
109. 0.083 3.143 ↓ 0.0 0 1

Unique (cost=344.83..344.89 rows=1 width=253) (actual time=3.131..3.143 rows=0 loops=1)

110. 0.047 3.060 ↓ 0.0 0 1

Sort (cost=344.83..344.84 rows=1 width=253) (actual time=3.047..3.060 rows=0 loops=1)

  • Sort Key: appointments_9.id, appointments_9.appointment_type, appointments_9.update_time, appointments_9.tms_id, appointments_9.tms_source, appointments_9.tractor_id, appointments_9.gate_pass_number, appointments_9.gp_open_time, appointments_9.gp_close_time, appointments_9.gp_expiration, appointments_9.gp_close_type, tractors_3.name, tractors_3.tractor_state, tractors_3.tractor_country, tractors_3.license_plate, tractors_3.carrier_id, carriers_3.name, carriers_3.carrier_code, trailers_6.name, trailers_7.name
  • Sort Method: quicksort Memory: 25kB
111. 0.013 3.013 ↓ 0.0 0 1

Nested Loop Left Join (cost=326.73..344.82 rows=1 width=253) (actual time=3.001..3.013 rows=0 loops=1)

112. 0.261 3.000 ↓ 0.0 0 1

Nested Loop Left Join (cost=326.45..344.48 rows=1 width=257) (actual time=2.987..3.000 rows=0 loops=1)

  • Join Filter: (tractors_3.carrier_id = carriers_3.id)
113. 0.013 2.739 ↓ 0.0 0 1

Nested Loop Left Join (cost=326.45..342.87 rows=1 width=193) (actual time=2.726..2.739 rows=0 loops=1)

114. 0.037 2.726 ↓ 0.0 0 1

Hash Right Join (cost=326.18..342.50 rows=1 width=189) (actual time=2.713..2.726 rows=0 loops=1)

  • Hash Cond: (appointments_10.id = appointments_9.id)
115. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=106.57..113.44 rows=687 width=24) (never executed)

  • Group Key: appointments_10.id, trailers_6.name
116. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=71.42..103.14 rows=687 width=24) (never executed)

  • Hash Cond: (assignments_10.trailer_id = trailers_6.id)
117. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=33.09..62.99 rows=687 width=8) (never executed)

  • Hash Cond: (assignments_10.appointment_id = appointments_10.id)
118. 0.000 0.000 ↓ 0.0 0

Seq Scan on assignments assignments_10 (cost=0.00..28.09 rows=687 width=8) (never executed)

  • Filter: (direction = 'Inbound'::trailerdirection)
119. 0.000 0.000 ↓ 0.0 0

Hash (cost=20.26..20.26 rows=1,026 width=4) (never executed)

120. 0.000 0.000 ↓ 0.0 0

Seq Scan on appointments appointments_10 (cost=0.00..20.26 rows=1,026 width=4) (never executed)

121. 0.000 0.000 ↓ 0.0 0

Hash (cost=24.26..24.26 rows=1,126 width=24) (never executed)

122. 0.000 0.000 ↓ 0.0 0

Seq Scan on trailers trailers_6 (cost=0.00..24.26 rows=1,126 width=24) (never executed)

123. 0.012 2.689 ↓ 0.0 0 1

Hash (cost=219.59..219.59 rows=1 width=169) (actual time=2.676..2.689 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
124. 0.023 2.677 ↓ 0.0 0 1

Hash Right Join (cost=203.43..219.59 rows=1 width=169) (actual time=2.664..2.677 rows=0 loops=1)

  • Hash Cond: (appointments_11.id = appointments_9.id)
125. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=106.50..113.30 rows=680 width=24) (never executed)

  • Group Key: appointments_11.id, trailers_7.name
126. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=71.42..103.10 rows=680 width=24) (never executed)

  • Hash Cond: (assignments_11.trailer_id = trailers_7.id)
127. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=33.09..62.97 rows=680 width=8) (never executed)

  • Hash Cond: (assignments_11.appointment_id = appointments_11.id)
128. 0.000 0.000 ↓ 0.0 0

Seq Scan on assignments assignments_11 (cost=0.00..28.09 rows=680 width=8) (never executed)

  • Filter: (direction = 'Outbound'::trailerdirection)
129. 0.000 0.000 ↓ 0.0 0

Hash (cost=20.26..20.26 rows=1,026 width=4) (never executed)

130. 0.000 0.000 ↓ 0.0 0

Seq Scan on appointments appointments_11 (cost=0.00..20.26 rows=1,026 width=4) (never executed)

131. 0.000 0.000 ↓ 0.0 0

Hash (cost=24.26..24.26 rows=1,126 width=24) (never executed)

132. 0.000 0.000 ↓ 0.0 0

Seq Scan on trailers trailers_7 (cost=0.00..24.26 rows=1,126 width=24) (never executed)

133. 0.012 2.654 ↓ 0.0 0 1

Hash (cost=96.92..96.92 rows=1 width=149) (actual time=2.641..2.654 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
134. 0.013 2.642 ↓ 0.0 0 1

Nested Loop (cost=0.28..96.92 rows=1 width=149) (actual time=2.629..2.642 rows=0 loops=1)

135. 2.629 2.629 ↓ 0.0 0 1

Seq Scan on tractors tractors_3 (cost=0.00..88.61 rows=1 width=45) (actual time=2.616..2.629 rows=0 loops=1)

  • Filter: ((name)::text ~~* '%%hi%%'::text)
  • Rows Removed by Filter: 2929
136. 0.000 0.000 ↓ 0.0 0

Index Scan using appointment_tractor_id_idx on appointments appointments_9 (cost=0.28..8.30 rows=1 width=108) (never executed)

  • Index Cond: (tractor_id = tractors_3.id)
  • Filter: ((gp_open_time IS NOT NULL) AND (site_id = 1))
137. 0.000 0.000 ↓ 0.0 0

Index Scan using assignment_appointment_id_idx on assignments assignments_9 (cost=0.28..0.36 rows=1 width=8) (never executed)

  • Index Cond: (appointments_9.id = appointment_id)
138. 0.000 0.000 ↓ 0.0 0

Seq Scan on carriers carriers_3 (cost=0.00..1.27 rows=27 width=68) (never executed)

139. 0.000 0.000 ↓ 0.0 0

Index Scan using assignment_delivery_assignment_id_idx on assignment_deliveries assignment_deliveries_3 (cost=0.28..0.33 rows=1 width=8) (never executed)

  • Index Cond: (assignments_9.id = assignment_id)
140. 0.012 2.294 ↓ 0.0 0 1

Unique (cost=344.83..344.89 rows=1 width=253) (actual time=2.282..2.294 rows=0 loops=1)

141. 0.051 2.282 ↓ 0.0 0 1

Sort (cost=344.83..344.84 rows=1 width=253) (actual time=2.269..2.282 rows=0 loops=1)

  • Sort Key: appointments_12.id, appointments_12.appointment_type, appointments_12.update_time, appointments_12.tms_id, appointments_12.tms_source, appointments_12.tractor_id, appointments_12.gate_pass_number, appointments_12.gp_open_time, appointments_12.gp_close_time, appointments_12.gp_expiration, appointments_12.gp_close_type, tractors_4.name, tractors_4.tractor_state, tractors_4.tractor_country, tractors_4.license_plate, tractors_4.carrier_id, carriers_4.name, carriers_4.carrier_code, trailers_8.name, trailers_9.name
  • Sort Method: quicksort Memory: 25kB
142. 0.014 2.231 ↓ 0.0 0 1

Nested Loop Left Join (cost=326.73..344.82 rows=1 width=253) (actual time=2.218..2.231 rows=0 loops=1)

143. 0.012 2.217 ↓ 0.0 0 1

Nested Loop Left Join (cost=326.45..344.48 rows=1 width=257) (actual time=2.205..2.217 rows=0 loops=1)

  • Join Filter: (tractors_4.carrier_id = carriers_4.id)
144. 0.012 2.205 ↓ 0.0 0 1

Nested Loop Left Join (cost=326.45..342.87 rows=1 width=193) (actual time=2.192..2.205 rows=0 loops=1)

145. 0.037 2.193 ↓ 0.0 0 1

Hash Right Join (cost=326.18..342.50 rows=1 width=189) (actual time=2.180..2.193 rows=0 loops=1)

  • Hash Cond: (appointments_13.id = appointments_12.id)
146. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=106.57..113.44 rows=687 width=24) (never executed)

  • Group Key: appointments_13.id, trailers_8.name
147. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=71.42..103.14 rows=687 width=24) (never executed)

  • Hash Cond: (assignments_13.trailer_id = trailers_8.id)
148. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=33.09..62.99 rows=687 width=8) (never executed)

  • Hash Cond: (assignments_13.appointment_id = appointments_13.id)
149. 0.000 0.000 ↓ 0.0 0

Seq Scan on assignments assignments_13 (cost=0.00..28.09 rows=687 width=8) (never executed)

  • Filter: (direction = 'Inbound'::trailerdirection)
150. 0.000 0.000 ↓ 0.0 0

Hash (cost=20.26..20.26 rows=1,026 width=4) (never executed)

151. 0.000 0.000 ↓ 0.0 0

Seq Scan on appointments appointments_13 (cost=0.00..20.26 rows=1,026 width=4) (never executed)

152. 0.000 0.000 ↓ 0.0 0

Hash (cost=24.26..24.26 rows=1,126 width=24) (never executed)

153. 0.000 0.000 ↓ 0.0 0

Seq Scan on trailers trailers_8 (cost=0.00..24.26 rows=1,126 width=24) (never executed)

154. 0.017 2.156 ↓ 0.0 0 1

Hash (cost=219.59..219.59 rows=1 width=169) (actual time=2.143..2.156 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
155. 0.062 2.139 ↓ 0.0 0 1

Hash Right Join (cost=203.43..219.59 rows=1 width=169) (actual time=2.127..2.139 rows=0 loops=1)

  • Hash Cond: (appointments_14.id = appointments_12.id)
156. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=106.50..113.30 rows=680 width=24) (never executed)

  • Group Key: appointments_14.id, trailers_9.name
157. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=71.42..103.10 rows=680 width=24) (never executed)

  • Hash Cond: (assignments_14.trailer_id = trailers_9.id)
158. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=33.09..62.97 rows=680 width=8) (never executed)

  • Hash Cond: (assignments_14.appointment_id = appointments_14.id)
159. 0.000 0.000 ↓ 0.0 0

Seq Scan on assignments assignments_14 (cost=0.00..28.09 rows=680 width=8) (never executed)

  • Filter: (direction = 'Outbound'::trailerdirection)
160. 0.000 0.000 ↓ 0.0 0

Hash (cost=20.26..20.26 rows=1,026 width=4) (never executed)

161. 0.000 0.000 ↓ 0.0 0

Seq Scan on appointments appointments_14 (cost=0.00..20.26 rows=1,026 width=4) (never executed)

162. 0.000 0.000 ↓ 0.0 0

Hash (cost=24.26..24.26 rows=1,126 width=24) (never executed)

163. 0.000 0.000 ↓ 0.0 0

Seq Scan on trailers trailers_9 (cost=0.00..24.26 rows=1,126 width=24) (never executed)

164. 0.014 2.077 ↓ 0.0 0 1

Hash (cost=96.92..96.92 rows=1 width=149) (actual time=2.064..2.077 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
165. 0.014 2.063 ↓ 0.0 0 1

Nested Loop (cost=0.28..96.92 rows=1 width=149) (actual time=2.050..2.063 rows=0 loops=1)

166. 2.049 2.049 ↓ 0.0 0 1

Seq Scan on tractors tractors_4 (cost=0.00..88.61 rows=1 width=45) (actual time=2.036..2.049 rows=0 loops=1)

  • Filter: ((license_plate)::text ~~* '%%hi%%'::text)
  • Rows Removed by Filter: 2929
167. 0.000 0.000 ↓ 0.0 0

Index Scan using appointment_tractor_id_idx on appointments appointments_12 (cost=0.28..8.30 rows=1 width=108) (never executed)

  • Index Cond: (tractor_id = tractors_4.id)
  • Filter: ((gp_open_time IS NOT NULL) AND (site_id = 1))
168. 0.000 0.000 ↓ 0.0 0

Index Scan using assignment_appointment_id_idx on assignments assignments_12 (cost=0.28..0.36 rows=1 width=8) (never executed)

  • Index Cond: (appointments_12.id = appointment_id)
169. 0.000 0.000 ↓ 0.0 0

Seq Scan on carriers carriers_4 (cost=0.00..1.27 rows=27 width=68) (never executed)

170. 0.000 0.000 ↓ 0.0 0

Index Scan using assignment_delivery_assignment_id_idx on assignment_deliveries assignment_deliveries_4 (cost=0.28..0.33 rows=1 width=8) (never executed)

  • Index Cond: (assignments_12.id = assignment_id)
171. 0.019 0.960 ↓ 0.0 0 1

HashAggregate (cost=596.92..610.56 rows=1,364 width=253) (actual time=0.947..0.960 rows=0 loops=1)

  • Group Key: appointments_15.id, appointments_15.appointment_type, appointments_15.update_time, appointments_15.tms_id, appointments_15.tms_source, appointments_15.site_id, appointments_15.tractor_id, appointments_15.gate_pass_number, appointments_15.gp_open_time, appointments_15.gp_close_time, appointments_15.gp_expiration, appointments_15.gp_close_type, tractors_5.name, tractors_5.tractor_state, tractors_5.tractor_country, tractors_5.license_plate, tractors_5.carrier_id, carriers_5.name, carriers_5.carrier_code, trailers_11.name, trailers_10.name
172. 0.012 0.941 ↓ 0.0 0 1

Hash Left Join (cost=400.93..525.31 rows=1,364 width=253) (actual time=0.928..0.941 rows=0 loops=1)

  • Hash Cond: (appointments_15.id = assignments_15.appointment_id)
173. 0.013 0.929 ↓ 0.0 0 1

Hash Left Join (cost=322.09..427.72 rows=1,024 width=253) (actual time=0.915..0.929 rows=0 loops=1)

  • Hash Cond: (tractors_5.carrier_id = carriers_5.id)
174. 0.012 0.916 ↓ 0.0 0 1

Hash Right Join (cost=320.49..423.00 rows=1,024 width=189) (actual time=0.903..0.916 rows=0 loops=1)

  • Hash Cond: (tractors_5.id = appointments_15.tractor_id)
175. 0.000 0.000 ↓ 0.0 0

Seq Scan on tractors tractors_5 (cost=0.00..81.29 rows=2,929 width=45) (never executed)

176. 0.027 0.904 ↓ 0.0 0 1

Hash (cost=307.69..307.69 rows=1,024 width=148) (actual time=0.877..0.904 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
177. 0.021 0.877 ↓ 0.0 0 1

Hash Right Join (cost=284.75..307.69 rows=1,024 width=148) (actual time=0.865..0.877 rows=0 loops=1)

  • Hash Cond: (appointments_16.id = appointments_15.id)
178. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=106.50..113.30 rows=680 width=24) (never executed)

  • Group Key: appointments_16.id, trailers_10.name
179. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=71.42..103.10 rows=680 width=24) (never executed)

  • Hash Cond: (assignments_16.trailer_id = trailers_10.id)
180. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=33.09..62.97 rows=680 width=8) (never executed)

  • Hash Cond: (assignments_16.appointment_id = appointments_16.id)
181. 0.000 0.000 ↓ 0.0 0

Seq Scan on assignments assignments_16 (cost=0.00..28.09 rows=680 width=8) (never executed)

  • Filter: (direction = 'Outbound'::trailerdirection)
182. 0.000 0.000 ↓ 0.0 0

Hash (cost=20.26..20.26 rows=1,026 width=4) (never executed)

183. 0.000 0.000 ↓ 0.0 0

Seq Scan on appointments appointments_16 (cost=0.00..20.26 rows=1,026 width=4) (never executed)

184. 0.000 0.000 ↓ 0.0 0

Hash (cost=24.26..24.26 rows=1,126 width=24) (never executed)

185. 0.000 0.000 ↓ 0.0 0

Seq Scan on trailers trailers_10 (cost=0.00..24.26 rows=1,126 width=24) (never executed)

186. 0.000 0.856 ↓ 0.0 0 1

Hash (cost=165.45..165.45 rows=1,024 width=128) (actual time=0.845..0.856 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
187. 0.050 0.869 ↓ 0.0 0 1

Hash Right Join (cost=149.89..165.45 rows=1,024 width=128) (actual time=0.832..0.869 rows=0 loops=1)

  • Hash Cond: (appointments_17.id = appointments_15.id)
188. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=106.57..113.44 rows=687 width=24) (never executed)

  • Group Key: appointments_17.id, trailers_11.name
189. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=71.42..103.14 rows=687 width=24) (never executed)

  • Hash Cond: (assignments_17.trailer_id = trailers_11.id)
190. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=33.09..62.99 rows=687 width=8) (never executed)

  • Hash Cond: (assignments_17.appointment_id = appointments_17.id)
191. 0.000 0.000 ↓ 0.0 0

Seq Scan on assignments assignments_17 (cost=0.00..28.09 rows=687 width=8) (never executed)

  • Filter: (direction = 'Inbound'::trailerdirection)
192. 0.000 0.000 ↓ 0.0 0

Hash (cost=20.26..20.26 rows=1,026 width=4) (never executed)

193. 0.000 0.000 ↓ 0.0 0

Seq Scan on appointments appointments_17 (cost=0.00..20.26 rows=1,026 width=4) (never executed)

194. 0.000 0.000 ↓ 0.0 0

Hash (cost=24.26..24.26 rows=1,126 width=24) (never executed)

195. 0.000 0.000 ↓ 0.0 0

Seq Scan on trailers trailers_11 (cost=0.00..24.26 rows=1,126 width=24) (never executed)

196. 0.091 0.819 ↓ 0.0 0 1

Hash (cost=30.52..30.52 rows=1,024 width=108) (actual time=0.806..0.819 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
197. 0.728 0.728 ↓ 0.0 0 1

Seq Scan on appointments appointments_15 (cost=0.00..30.52 rows=1,024 width=108) (actual time=0.715..0.728 rows=0 loops=1)

  • Filter: ((gp_open_time IS NOT NULL) AND (site_id = 1) AND (((gate_pass_number)::character varying)::text ~~* '%%hi%%'::text))
  • Rows Removed by Filter: 1026
198. 0.000 0.000 ↓ 0.0 0

Hash (cost=1.27..1.27 rows=27 width=68) (never executed)

199. 0.000 0.000 ↓ 0.0 0

Seq Scan on carriers carriers_5 (cost=0.00..1.27 rows=27 width=68) (never executed)

200. 0.000 0.000 ↓ 0.0 0

Hash (cost=61.75..61.75 rows=1,367 width=4) (never executed)

201. 0.000 0.000 ↓ 0.0 0

Hash Right Join (cost=41.76..61.75 rows=1,367 width=4) (never executed)

  • Hash Cond: (assignment_deliveries_5.assignment_id = assignments_15.id)
202. 0.000 0.000 ↓ 0.0 0

Seq Scan on assignment_deliveries assignment_deliveries_5 (cost=0.00..17.28 rows=1,028 width=8) (never executed)

203. 0.000 0.000 ↓ 0.0 0

Hash (cost=24.67..24.67 rows=1,367 width=8) (never executed)

204. 0.000 0.000 ↓ 0.0 0

Seq Scan on assignments assignments_15 (cost=0.00..24.67 rows=1,367 width=8) (never executed)

205. 23.587 315.787 ↓ 1.1 341 1

HashAggregate (cost=463.17..466.35 rows=318 width=253) (actual time=304.561..315.787 rows=341 loops=1)

  • Group Key: appointments_18.id, appointments_18.appointment_type, appointments_18.update_time, appointments_18.tms_id, appointments_18.tms_source, appointments_18.site_id, appointments_18.tractor_id, appointments_18.gate_pass_number, appointments_18.gp_open_time, appointments_18.gp_close_time, appointments_18.gp_expiration, appointments_18.gp_close_type, tractors_6.name, tractors_6.tractor_state, tractors_6.tractor_country, tractors_6.license_plate, tractors_6.carrier_id, carriers_6.name, carriers_6.carrier_code, trailers_12.name, trailers_13.name
206. 17.801 292.200 ↓ 2.1 682 1

Hash Left Join (cost=418.57..446.47 rows=318 width=253) (actual time=236.839..292.200 rows=682 loops=1)

  • Hash Cond: (tractors_6.carrier_id = carriers_6.id)
207. 23.958 274.342 ↓ 2.1 682 1

Hash Right Join (cost=417.22..440.75 rows=318 width=189) (actual time=236.754..274.342 rows=682 loops=1)

  • Hash Cond: (assignment_deliveries_6.assignment_id = assignments_18.id)
208. 13.716 13.716 ↑ 1.0 1,028 1

Seq Scan on assignment_deliveries assignment_deliveries_6 (cost=0.00..17.28 rows=1,028 width=8) (actual time=0.023..13.716 rows=1,028 loops=1)

209. 5.268 236.668 ↓ 2.1 682 1

Hash (cost=413.25..413.25 rows=318 width=193) (actual time=236.655..236.668 rows=682 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 131kB
210. 14.927 231.400 ↓ 2.1 682 1

Hash Right Join (cost=380.28..413.25 rows=318 width=193) (actual time=206.811..231.400 rows=682 loops=1)

  • Hash Cond: (assignments_18.appointment_id = appointments_18.id)
211. 9.719 9.719 ↑ 1.0 1,367 1

Seq Scan on assignments assignments_18 (cost=0.00..24.67 rows=1,367 width=8) (actual time=0.026..9.719 rows=1,367 loops=1)

212. 2.662 206.754 ↓ 1.4 341 1

Hash (cost=377.31..377.31 rows=238 width=189) (actual time=206.742..206.754 rows=341 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 68kB
213. 7.723 204.092 ↓ 1.4 341 1

Hash Right Join (cost=359.40..377.31 rows=238 width=189) (actual time=191.548..204.092 rows=341 loops=1)

  • Hash Cond: (appointments_19.id = appointments_18.id)
214. 12.305 82.920 ↑ 1.0 687 1

HashAggregate (cost=106.57..113.44 rows=687 width=24) (actual time=78.061..82.920 rows=687 loops=1)

  • Group Key: appointments_19.id, trailers_12.name
215. 14.052 70.615 ↑ 1.0 687 1

Hash Join (cost=71.42..103.14 rows=687 width=24) (actual time=32.593..70.615 rows=687 loops=1)

  • Hash Cond: (assignments_19.trailer_id = trailers_12.id)
216. 16.094 39.281 ↑ 1.0 687 1

Hash Join (cost=33.09..62.99 rows=687 width=8) (actual time=15.264..39.281 rows=687 loops=1)

  • Hash Cond: (assignments_19.appointment_id = appointments_19.id)
217. 7.968 7.968 ↑ 1.0 687 1

Seq Scan on assignments assignments_19 (cost=0.00..28.09 rows=687 width=8) (actual time=0.018..7.968 rows=687 loops=1)

  • Filter: (direction = 'Inbound'::trailerdirection)
  • Rows Removed by Filter: 680
218. 7.800 15.219 ↑ 1.0 1,026 1

Hash (cost=20.26..20.26 rows=1,026 width=4) (actual time=15.205..15.219 rows=1,026 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 53kB
219. 7.419 7.419 ↑ 1.0 1,026 1

Seq Scan on appointments appointments_19 (cost=0.00..20.26 rows=1,026 width=4) (actual time=0.013..7.419 rows=1,026 loops=1)

220. 8.170 17.282 ↑ 1.0 1,126 1

Hash (cost=24.26..24.26 rows=1,126 width=24) (actual time=17.268..17.282 rows=1,126 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 79kB
221. 9.112 9.112 ↑ 1.0 1,126 1

Seq Scan on trailers trailers_12 (cost=0.00..24.26 rows=1,126 width=24) (actual time=0.026..9.112 rows=1,126 loops=1)

222. 2.733 113.449 ↓ 1.4 341 1

Hash (cost=249.86..249.86 rows=238 width=169) (actual time=113.436..113.449 rows=341 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 60kB
223. 7.058 110.716 ↓ 1.4 341 1

Hash Right Join (cost=232.13..249.86 rows=238 width=169) (actual time=98.648..110.716 rows=341 loops=1)

  • Hash Cond: (appointments_20.id = appointments_18.id)
224. 10.644 70.400 ↑ 1.0 680 1

HashAggregate (cost=106.50..113.30 rows=680 width=24) (actual time=65.372..70.400 rows=680 loops=1)

  • Group Key: appointments_20.id, trailers_13.name
225. 9.746 59.756 ↑ 1.0 680 1

Hash Join (cost=71.42..103.10 rows=680 width=24) (actual time=34.590..59.756 rows=680 loops=1)

  • Hash Cond: (assignments_20.trailer_id = trailers_13.id)
226. 10.398 32.524 ↑ 1.0 680 1

Hash Join (cost=33.09..62.97 rows=680 width=8) (actual time=17.076..32.524 rows=680 loops=1)

  • Hash Cond: (assignments_20.appointment_id = appointments_20.id)
227. 5.109 5.109 ↑ 1.0 680 1

Seq Scan on assignments assignments_20 (cost=0.00..28.09 rows=680 width=8) (actual time=0.025..5.109 rows=680 loops=1)

  • Filter: (direction = 'Outbound'::trailerdirection)
  • Rows Removed by Filter: 687
228. 9.180 17.017 ↑ 1.0 1,026 1

Hash (cost=20.26..20.26 rows=1,026 width=4) (actual time=17.003..17.017 rows=1,026 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 53kB
229. 7.837 7.837 ↑ 1.0 1,026 1

Seq Scan on appointments appointments_20 (cost=0.00..20.26 rows=1,026 width=4) (actual time=0.017..7.837 rows=1,026 loops=1)

230. 8.477 17.486 ↑ 1.0 1,126 1

Hash (cost=24.26..24.26 rows=1,126 width=24) (actual time=17.473..17.486 rows=1,126 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 79kB
231. 9.009 9.009 ↑ 1.0 1,126 1

Seq Scan on trailers trailers_13 (cost=0.00..24.26 rows=1,126 width=24) (actual time=0.069..9.009 rows=1,126 loops=1)

232. 2.873 33.258 ↓ 1.4 341 1

Hash (cost=122.65..122.65 rows=238 width=149) (actual time=33.246..33.258 rows=341 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 52kB
233. 10.525 30.385 ↓ 1.4 341 1

Hash Join (cost=97.14..122.65 rows=238 width=149) (actual time=11.653..30.385 rows=341 loops=1)

  • Hash Cond: (appointments_18.tractor_id = tractors_6.id)
234. 8.237 8.237 ↑ 1.0 1,024 1

Seq Scan on appointments appointments_18 (cost=0.00..22.83 rows=1,024 width=108) (actual time=0.013..8.237 rows=1,024 loops=1)

  • Filter: ((gp_open_time IS NOT NULL) AND (site_id = 1))
  • Rows Removed by Filter: 2
235. 5.952 11.623 ↑ 1.0 682 1

Hash (cost=88.61..88.61 rows=682 width=45) (actual time=11.611..11.623 rows=682 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 63kB
236. 5.671 5.671 ↑ 1.0 682 1

Seq Scan on tractors tractors_6 (cost=0.00..88.61 rows=682 width=45) (actual time=0.012..5.671 rows=682 loops=1)

  • Filter: (carrier_id = 7)
  • Rows Removed by Filter: 2247
237. 0.022 0.057 ↑ 1.0 1 1

Hash (cost=1.34..1.34 rows=1 width=68) (actual time=0.045..0.057 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
238. 0.035 0.035 ↑ 1.0 1 1

Seq Scan on carriers carriers_6 (cost=0.00..1.34 rows=1 width=68) (actual time=0.015..0.035 rows=1 loops=1)

  • Filter: (id = 7)
  • Rows Removed by Filter: 26
239. 5,526.070 34,854.959 ↑ 458.2 1,024 1

Unique (cost=162,876.65..187,510.49 rows=469,216 width=253) (actual time=24,190.960..34,854.959 rows=1,024 loops=1)

240. 14,581.471 29,328.889 ↓ 1.0 469,560 1

Sort (cost=162,876.65..164,049.69 rows=469,216 width=253) (actual time=24,190.944..29,328.889 rows=469,560 loops=1)

  • Sort Key: appointments_21.id, appointments_21.appointment_type, appointments_21.update_time, appointments_21.tms_id, appointments_21.tms_source, appointments_21.tractor_id, appointments_21.gate_pass_number, appointments_21.gp_open_time, appointments_21.gp_close_time, appointments_21.gp_expiration, appointments_21.gp_close_type, tractors_7.name, tractors_7.tractor_state, tractors_7.tractor_country, tractors_7.license_plate, tractors_7.carrier_id, carriers_7.name, carriers_7.carrier_code, trailers_16.name, trailers_15.name
  • Sort Method: external merge Disk: 76320kB
241. 9,548.502 14,747.418 ↓ 1.0 469,560 1

Nested Loop (cost=393.23..6,410.75 rows=469,216 width=253) (actual time=276.523..14,747.418 rows=469,560 loops=1)

242. 31.237 422.781 ↓ 1.0 1,365 1

Hash Left Join (cost=393.23..517.62 rows=1,364 width=253) (actual time=276.364..422.781 rows=1,365 loops=1)

  • Hash Cond: (appointments_21.id = assignments_21.appointment_id)
243. 23.317 323.192 ↑ 1.0 1,024 1

Hash Left Join (cost=314.40..420.02 rows=1,024 width=253) (actual time=207.987..323.192 rows=1,024 loops=1)

  • Hash Cond: (tractors_7.carrier_id = carriers_7.id)
244. 54.309 299.341 ↑ 1.0 1,024 1

Hash Right Join (cost=312.79..415.30 rows=1,024 width=189) (actual time=207.431..299.341 rows=1,024 loops=1)

  • Hash Cond: (tractors_7.id = appointments_21.tractor_id)
245. 37.649 37.649 ↑ 1.0 2,929 1

Seq Scan on tractors tractors_7 (cost=0.00..81.29 rows=2,929 width=45) (actual time=0.026..37.649 rows=2,929 loops=1)

246. 7.560 207.383 ↑ 1.0 1,024 1

Hash (cost=299.99..299.99 rows=1,024 width=148) (actual time=207.371..207.383 rows=1,024 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 120kB
247. 12.649 199.823 ↑ 1.0 1,024 1

Hash Right Join (cost=277.05..299.99 rows=1,024 width=148) (actual time=182.022..199.823 rows=1,024 loops=1)

  • Hash Cond: (appointments_22.id = appointments_21.id)
248. 10.673 70.097 ↑ 1.0 680 1

HashAggregate (cost=106.50..113.30 rows=680 width=24) (actual time=64.894..70.097 rows=680 loops=1)

  • Group Key: appointments_22.id, trailers_15.name
249. 9.807 59.424 ↑ 1.0 680 1

Hash Join (cost=71.42..103.10 rows=680 width=24) (actual time=34.566..59.424 rows=680 loops=1)

  • Hash Cond: (assignments_22.trailer_id = trailers_15.id)
250. 10.131 30.989 ↑ 1.0 680 1

Hash Join (cost=33.09..62.97 rows=680 width=8) (actual time=15.914..30.989 rows=680 loops=1)

  • Hash Cond: (assignments_22.appointment_id = appointments_22.id)
251. 4.992 4.992 ↑ 1.0 680 1

Seq Scan on assignments assignments_22 (cost=0.00..28.09 rows=680 width=8) (actual time=0.017..4.992 rows=680 loops=1)

  • Filter: (direction = 'Outbound'::trailerdirection)
  • Rows Removed by Filter: 687
252. 7.993 15.866 ↑ 1.0 1,026 1

Hash (cost=20.26..20.26 rows=1,026 width=4) (actual time=15.854..15.866 rows=1,026 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 53kB
253. 7.873 7.873 ↑ 1.0 1,026 1

Seq Scan on appointments appointments_22 (cost=0.00..20.26 rows=1,026 width=4) (actual time=0.013..7.873 rows=1,026 loops=1)

254. 9.690 18.628 ↑ 1.0 1,126 1

Hash (cost=24.26..24.26 rows=1,126 width=24) (actual time=18.616..18.628 rows=1,126 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 79kB
255. 8.938 8.938 ↑ 1.0 1,126 1

Seq Scan on trailers trailers_15 (cost=0.00..24.26 rows=1,126 width=24) (actual time=0.022..8.938 rows=1,126 loops=1)

256. 7.868 117.077 ↑ 1.0 1,024 1

Hash (cost=157.75..157.75 rows=1,024 width=128) (actual time=117.064..117.077 rows=1,024 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 105kB
257. 12.635 109.209 ↑ 1.0 1,024 1

Hash Right Join (cost=142.20..157.75 rows=1,024 width=128) (actual time=91.260..109.209 rows=1,024 loops=1)

  • Hash Cond: (appointments_23.id = appointments_21.id)
258. 10.859 71.764 ↑ 1.0 687 1

HashAggregate (cost=106.57..113.44 rows=687 width=24) (actual time=66.425..71.764 rows=687 loops=1)

  • Group Key: appointments_23.id, trailers_16.name
259. 10.905 60.905 ↑ 1.0 687 1

Hash Join (cost=71.42..103.14 rows=687 width=24) (actual time=34.025..60.905 rows=687 loops=1)

  • Hash Cond: (assignments_23.trailer_id = trailers_16.id)
260. 10.654 31.380 ↑ 1.0 687 1

Hash Join (cost=33.09..62.99 rows=687 width=8) (actual time=15.376..31.380 rows=687 loops=1)

  • Hash Cond: (assignments_23.appointment_id = appointments_23.id)
261. 5.401 5.401 ↑ 1.0 687 1

Seq Scan on assignments assignments_23 (cost=0.00..28.09 rows=687 width=8) (actual time=0.021..5.401 rows=687 loops=1)

  • Filter: (direction = 'Inbound'::trailerdirection)
  • Rows Removed by Filter: 680
262. 8.022 15.325 ↑ 1.0 1,026 1

Hash (cost=20.26..20.26 rows=1,026 width=4) (actual time=15.312..15.325 rows=1,026 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 53kB
263. 7.303 7.303 ↑ 1.0 1,026 1

Seq Scan on appointments appointments_23 (cost=0.00..20.26 rows=1,026 width=4) (actual time=0.013..7.303 rows=1,026 loops=1)

264. 9.057 18.620 ↑ 1.0 1,126 1

Hash (cost=24.26..24.26 rows=1,126 width=24) (actual time=18.607..18.620 rows=1,126 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 79kB
265. 9.563 9.563 ↑ 1.0 1,126 1

Seq Scan on trailers trailers_16 (cost=0.00..24.26 rows=1,126 width=24) (actual time=0.015..9.563 rows=1,126 loops=1)

266. 12.776 24.810 ↑ 1.0 1,024 1

Hash (cost=22.83..22.83 rows=1,024 width=108) (actual time=24.797..24.810 rows=1,024 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 88kB
267. 12.034 12.034 ↑ 1.0 1,024 1

Seq Scan on appointments appointments_21 (cost=0.00..22.83 rows=1,024 width=108) (actual time=0.356..12.034 rows=1,024 loops=1)

  • Filter: ((gp_open_time IS NOT NULL) AND (site_id = 1))
  • Rows Removed by Filter: 2
268. 0.319 0.534 ↑ 1.0 27 1

Hash (cost=1.27..1.27 rows=27 width=68) (actual time=0.521..0.534 rows=27 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
269. 0.215 0.215 ↑ 1.0 27 1

Seq Scan on carriers carriers_7 (cost=0.00..1.27 rows=27 width=68) (actual time=0.012..0.215 rows=27 loops=1)

270. 11.641 68.352 ↑ 1.0 1,367 1

Hash (cost=61.75..61.75 rows=1,367 width=4) (actual time=68.340..68.352 rows=1,367 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 65kB
271. 19.940 56.711 ↑ 1.0 1,367 1

Hash Right Join (cost=41.76..61.75 rows=1,367 width=4) (actual time=28.533..56.711 rows=1,367 loops=1)

  • Hash Cond: (assignment_deliveries_7.assignment_id = assignments_21.id)
272. 8.278 8.278 ↑ 1.0 1,028 1

Seq Scan on assignment_deliveries assignment_deliveries_7 (cost=0.00..17.28 rows=1,028 width=8) (actual time=0.020..8.278 rows=1,028 loops=1)

273. 14.661 28.493 ↑ 1.0 1,367 1

Hash (cost=24.67..24.67 rows=1,367 width=8) (actual time=28.481..28.493 rows=1,367 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 70kB
274. 13.832 13.832 ↑ 1.0 1,367 1

Seq Scan on assignments assignments_21 (cost=0.00..24.67 rows=1,367 width=8) (actual time=0.013..13.832 rows=1,367 loops=1)

275. 4,773.591 4,776.135 ↑ 1.0 344 1,365

Materialize (cost=0.00..28.80 rows=344 width=0) (actual time=0.009..3.499 rows=344 loops=1,365)

276. 2.544 2.544 ↑ 1.0 344 1

Seq Scan on trailers trailers_14 (cost=0.00..27.08 rows=344 width=0) (actual time=0.080..2.544 rows=344 loops=1)

  • Filter: (carrier_id = 7)
  • Rows Removed by Filter: 782
Planning time : 41.350 ms
Execution time : 35,762.876 ms