explain.depesz.com

PostgreSQL's explain analyze made readable

Result: pG6n

Settings
# exclusive inclusive rows x rows loops node
1. 2,025.926 4,742.357 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=49,313.39..62,866.00 rows=1 width=1,742) (actual time=1,664.029..4,742.357 rows=6,553 loops=1)

  • Join Filter: ((rp.route_id)::integer = (cr_rpa.route_id)::integer)
  • Rows Removed by Join Filter: 124,488
2.          

CTE meta_control_routes

3. 87.351 417.332 ↓ 6,553.0 6,553 1

GroupAggregate (cost=41,913.66..42,398.54 rows=1 width=174) (actual time=144.568..417.332 rows=6,553 loops=1)

  • Group Key: r_2.car_id, c_1.last_route_id, r_2.id, r_2.open_date, d.distribution_center_name, d.distribution_center_id, d.datetime, cto.is_own
4. 13.687 150.885 ↓ 6,754.0 6,754 1

Sort (cost=41,913.66..41,913.67 rows=1 width=174) (actual time=144.515..150.885 rows=6,754 loops=1)

  • Sort Key: r_2.car_id, c_1.last_route_id, r_2.id, r_2.open_date, d.distribution_center_name, d.distribution_center_id, d.datetime, cto.is_own
  • Sort Method: quicksort Memory: 2,209kB
5. 25.178 137.198 ↓ 6,754.0 6,754 1

Nested Loop (cost=76.73..41,913.65 rows=1 width=174) (actual time=0.544..137.198 rows=6,754 loops=1)

6. 0.499 85.796 ↓ 6,556.0 6,556 1

Nested Loop (cost=76.30..41,909.15 rows=1 width=60) (actual time=0.502..85.796 rows=6,556 loops=1)

7. 4.269 72.183 ↓ 6,557.0 6,557 1

Nested Loop (cost=76.02..41,908.83 rows=1 width=34) (actual time=0.496..72.183 rows=6,557 loops=1)

8. 13.095 38.534 ↓ 1.1 7,345 1

Hash Join (cost=75.58..4,200.01 rows=6,497 width=9) (actual time=0.485..38.534 rows=7,345 loops=1)

  • Hash Cond: ((c_1.company_owner_id)::integer = (cto.id)::integer)
  • Join Filter: (cto.is_own OR ((NOT cto.is_own) AND (c_1.gps_device_id IS NOT NULL)))
  • Rows Removed by Join Filter: 53,123
9. 24.972 24.972 ↑ 1.0 60,468 1

Seq Scan on cars c_1 (cost=0.00..3,292.99 rows=60,468 width=16) (actual time=0.006..24.972 rows=60,468 loops=1)

  • Filter: (NOT archive)
  • Rows Removed by Filter: 28,131
10. 0.141 0.467 ↑ 1.0 1,226 1

Hash (cost=60.26..60.26 rows=1,226 width=5) (actual time=0.467..0.467 rows=1,226 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 64kB
11. 0.326 0.326 ↑ 1.0 1,226 1

Seq Scan on cars_trailers_owners cto (cost=0.00..60.26 rows=1,226 width=5) (actual time=0.003..0.326 rows=1,226 loops=1)

12. 29.380 29.380 ↑ 1.0 1 7,345

Index Scan using routes_pkey on routes r_2 (cost=0.43..5.79 rows=1 width=29) (actual time=0.003..0.004 rows=1 loops=7,345)

  • Index Cond: ((id)::integer = (c_1.last_route_id)::integer)
  • Filter: (opened AND ((c_1.id)::integer = (car_id)::integer))
13. 13.114 13.114 ↑ 1.0 1 6,557

Index Scan using delivery_pkey on deliveries d (cost=0.29..0.30 rows=1 width=34) (actual time=0.002..0.002 rows=1 loops=6,557)

  • Index Cond: ((id)::integer = (r_2.delivery_id)::integer)
  • Filter: accepted
14. 26.224 26.224 ↑ 10.0 1 6,556

Index Scan using drivers_pkey1 on drivers dr (cost=0.43..4.41 rows=10 width=121) (actual time=0.003..0.004 rows=1 loops=6,556)

  • Index Cond: ((id)::integer = ANY ((regexp_split_to_array((r_2.current_drivers_id)::text, ','::text))::integer[]))
15.          

SubPlan (for GroupAggregate)

16. 6.553 52.424 ↓ 0.0 0 6,553

Limit (cost=456.53..456.53 rows=1 width=16) (actual time=0.008..0.008 rows=0 loops=6,553)

17. 6.553 45.871 ↓ 0.0 0 6,553

Sort (cost=456.53..456.81 rows=113 width=16) (actual time=0.007..0.007 rows=0 loops=6,553)

  • Sort Key: r2.open_date, r2.open_date_disp
  • Sort Method: quicksort Memory: 25kB
18. 39.318 39.318 ↓ 0.0 0 6,553

Index Scan using routes_idx1 on routes r2 (cost=0.43..455.96 rows=113 width=16) (actual time=0.006..0.006 rows=0 loops=6,553)

  • Index Cond: (((car_id)::integer = (r_2.car_id)::integer) AND ((open_date)::timestamp without time zone > (r_2.open_date)::timestamp without time zone))
19. 36.316 126.672 ↓ 0.0 0 4,872

Hash Join (cost=25.61..28.28 rows=1 width=0) (actual time=0.026..0.026 rows=0 loops=4,872)

  • Hash Cond: (mp.market_id = (rpm.object_id)::integer)
20. 22.148 22.148 ↑ 1.0 89 3,164

Seq Scan on markets_passes mp (cost=0.00..1.89 rows=89 width=4) (actual time=0.002..0.007 rows=89 loops=3,164)

21. 9.744 68.208 ↑ 1.2 4 4,872

Hash (cost=25.54..25.54 rows=5 width=4) (actual time=0.014..0.014 rows=4 loops=4,872)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
22. 58.464 58.464 ↑ 1.2 4 4,872

Index Scan using routes_points_manual_idx1 on routes_points_manual rpm (cost=0.43..25.54 rows=5 width=4) (actual time=0.006..0.012 rows=4 loops=4,872)

  • Index Cond: ((route_id)::integer = (r_2.id)::integer)
  • Filter: ((object_var)::text = 'market'::text)
  • Rows Removed by Filter: 4
23. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=3.00..466,201.70 rows=9,835 width=4) (never executed)

  • Hash Cond: ((rpm_1.object_id)::integer = mp_1.market_id)
24. 0.000 0.000 ↓ 0.0 0

Seq Scan on routes_points_manual rpm_1 (cost=0.00..449,912.25 rows=3,237,620 width=8) (never executed)

  • Filter: ((object_var)::text = 'market'::text)
25. 0.000 0.000 ↓ 0.0 0

Hash (cost=1.89..1.89 rows=89 width=4) (never executed)

26. 0.000 0.000 ↓ 0.0 0

Seq Scan on markets_passes mp_1 (cost=0.00..1.89 rows=89 width=4) (never executed)

27.          

CTE controled_routes

28. 90.095 910.088 ↓ 6,553.0 6,553 1

Hash Left Join (cost=14.31..62.66 rows=1 width=173) (actual time=144.764..910.088 rows=6,553 loops=1)

  • Hash Cond: (CASE WHEN (r_4.routes_type_transits IS NOT NULL) THEN CASE WHEN ((d_1.distribution_center_name)::text = 'Челнок'::text) THEN ((($16) -> 'CHELNOK'::text))::integer WHEN ((r_4.routes_types_services IS NOT NULL) AND (COALESCE(r_4.type_ext, '-1'::integer) = 0)) THEN ((($16) -> 'EMPTY_TD'::text))::integer WHEN ((r_4.deliveries_cars_tasks_id IS NOT NULL) AND (NOT (hashed SubPlan 6)) AND (NOT (hashed SubPlan 7))) THEN CASE WHEN ((dct.deliveries_cars_tasks_types_id)::integer = (((hstore((array_agg((dcttt.name)::character varying))::text[], (array_agg((dcttt.id)::integer))::text[])) -> 'Портовый'::text))::integer) THEN ((($16) -> 'PORT'::text))::integer WHEN ((dct.deliveries_cars_tasks_types_id)::integer = (((hstore((array_agg((dcttt.name)::character varying))::text[], (array_agg((dcttt.id)::integer))::text[])) -> 'Международный'::text))::integer) THEN ((($16) -> 'MD'::text))::integer WHEN ((dct.deliveries_cars_tasks_types_id)::integer = (((hstore((array_agg((dcttt.name)::character varying))::text[], (array_agg((dcttt.id)::integer))::text[])) -> 'Коммерческий'::text))::integer) THEN ((($16) -> 'COMMERCE'::text))::integer ELSE ((($16) -> 'TD'::text))::integer END ELSE CASE WHEN (r_4.functional_transferred IS NOT NULL) THEN CASE WHEN (r_4.functional_transferred = (((hstore((array_agg((dcttt.name)::character varying))::text[], (array_agg((dcttt.id)::integer))::text[])) -> 'Портовый'::text))::integer) THEN ((($16) -> 'PORT'::text))::integer WHEN (r_4.functional_transferred = (((hstore((array_agg((dcttt.name)::character varying))::text[], (array_agg((dcttt.id)::integer))::text[])) -> 'Международный'::text))::integer) THEN ((($16) -> 'MD'::text))::integer WHEN (r_4.functional_transferred = (((hstore((array_agg((dcttt.name)::character varying))::text[], (array_agg((dcttt.id)::integer))::text[])) -> 'Коммерческий'::text))::integer) THEN ((($16) -> 'COMMERCE'::text))::integer ELSE ((($16) -> 'TD'::text))::integer END ELSE CASE WHEN (r_4.functional = ANY ((string_to_array(((hstore((array_agg((dcttt.name)::character varying))::text[], (array_agg((dcttt.functionals_lists)::character varying))::text[])) -> 'Портовый'::text), ','::text))::integer[])) THEN ((($16) -> 'PORT'::text))::integer WHEN (r_4.functional = ANY ((string_to_array(((hstore((array_agg((dcttt.name)::character varying))::text[], (array_agg((dcttt.functionals_lists)::character varying))::text[])) -> 'Международный'::text), ','::text))::integer[])) THEN ((($16) -> 'MD'::text))::integer WHEN (r_4.functional = ANY ((string_to_array(((hstore((array_agg((dcttt.name)::character varying))::text[], (array_agg((dcttt.functionals_lists)::character varying))::text[])) -> 'Коммерческий'::text), ','::text))::integer[])) THEN ((($16) -> 'COMMERCE'::text))::integer ELSE ((($16) -> 'TD'::text))::integer END END END ELSE CASE WHEN ((r_4.is_transits_warehouses IS TRUE) OR ((r_4.car_traffic_direction_name)::text ~* 'Не ПД'::text)) THEN ((($16) -> 'WAREHOUSES'::text))::integer WHEN (r_4.opened_backwards IS TRUE) THEN CASE WHEN (alternatives: SubPlan 8 or hashed SubPlan 9) THEN ((($16) -> 'BACKWARDS_TD'::text))::integer ELSE ((($16) -> 'BACKWARDS_PD'::text))::integer END WHEN (alternatives: SubPlan 10 or hashed SubPlan 11) THEN ((($16) -> 'PD'::text))::integer WHEN (r_4.routes_types_services IS NOT NULL) THEN CASE COALESCE(r_4.type_ext, '-1'::integer) WHEN 0 THEN ((($16) -> 'EMPTY_PD'::text))::integer WHEN 1 THEN ((($16) -> 'TRIP'::text))::integer ELSE ((($16) -> 'SERVICE'::text))::integer END ELSE ((($16) -> 'PD'::text))::integer END END = rt.id)
29. 13.029 590.130 ↓ 6,553.0 6,553 1

Nested Loop (cost=3.36..11.51 rows=1 width=308) (actual time=144.659..590.130 rows=6,553 loops=1)

30. 3.815 505.018 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=1.01..9.11 rows=1 width=212) (actual time=144.586..505.018 rows=6,553 loops=1)

31. 1.664 494.650 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=0.72..8.79 rows=1 width=208) (actual time=144.583..494.650 rows=6,553 loops=1)

32. 11.785 473.327 ↓ 6,553.0 6,553 1

Nested Loop (cost=0.43..8.48 rows=1 width=194) (actual time=144.579..473.327 rows=6,553 loops=1)

33. 428.777 428.777 ↓ 6,553.0 6,553 1

CTE Scan on meta_control_routes mcr (cost=0.00..0.02 rows=1 width=154) (actual time=144.572..428.777 rows=6,553 loops=1)

34. 32.765 32.765 ↑ 1.0 1 6,553

Index Scan using routes_pkey on routes r_4 (cost=0.43..8.45 rows=1 width=40) (actual time=0.005..0.005 rows=1 loops=6,553)

  • Index Cond: ((id)::integer = (mcr.route_id)::integer)
35. 19.659 19.659 ↑ 1.0 1 6,553

Index Scan using delivery_pkey on deliveries d_1 (cost=0.29..0.30 rows=1 width=22) (actual time=0.002..0.003 rows=1 loops=6,553)

  • Index Cond: ((id)::integer = (r_4.delivery_id)::integer)
36. 6.553 6.553 ↓ 0.0 0 6,553

Index Scan using deliveries_cars_tasks_pkey on deliveries_cars_tasks dct (cost=0.29..0.31 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=6,553)

  • Index Cond: ((id)::integer = (r_4.deliveries_cars_tasks_id)::integer)
37. 65.496 72.083 ↑ 1.0 1 6,553

Aggregate (cost=2.35..2.37 rows=1 width=34) (actual time=0.011..0.011 rows=1 loops=6,553)

38.          

Initplan (for Aggregate)

39. 0.031 0.034 ↑ 1.0 1 1

Aggregate (cost=1.24..1.26 rows=1 width=11) (actual time=0.033..0.034 rows=1 loops=1)

40. 0.003 0.003 ↑ 1.0 16 1

Seq Scan on routes_types t_1 (cost=0.00..1.16 rows=16 width=11) (actual time=0.003..0.003 rows=16 loops=1)

41. 6.553 6.553 ↑ 1.0 4 6,553

Seq Scan on deliveries_cars_tasks_types dcttt (cost=0.00..1.04 rows=4 width=34) (actual time=0.001..0.001 rows=4 loops=6,553)

42. 0.004 0.008 ↑ 1.0 16 1

Hash (cost=1.16..1.16 rows=16 width=27) (actual time=0.008..0.008 rows=16 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
43. 0.004 0.004 ↑ 1.0 16 1

Seq Scan on routes_types rt (cost=0.00..1.16 rows=16 width=27) (actual time=0.002..0.004 rows=16 loops=1)

44.          

SubPlan (for Hash Left Join)

45. 52.424 196.590 ↑ 1.0 1 6,553

Aggregate (cost=32.10..32.11 rows=1 width=16) (actual time=0.030..0.030 rows=1 loops=6,553)

46. 58.977 144.166 ↓ 4.0 8 6,553

Nested Loop (cost=0.87..32.10 rows=2 width=16) (actual time=0.011..0.022 rows=8 loops=6,553)

  • Join Filter: ((COALESCE(rpa.open_route_point, false) = COALESCE(r_3.opened, false)) AND CASE WHEN (r_3.routes_type_transits IS NOT NULL) THEN ((rpa.type_id)::integer = ANY ('{3,4}'::integer[])) WHEN (r_3.routes_type = 0) THEN ((rpa.type_id)::integer = ANY ('{1,4}'::integer[])) WHEN (r_3.routes_type = 1) THEN ((rpa.type_id)::integer = ANY ('{2,4}'::integer[])) ELSE false END)
  • Rows Removed by Join Filter: 0
47. 19.659 19.659 ↑ 1.0 1 6,553

Index Scan using routes_pkey on routes r_3 (cost=0.43..8.45 rows=1 width=9) (actual time=0.003..0.003 rows=1 loops=6,553)

  • Index Cond: ((id)::integer = (mcr.route_id)::integer)
48. 65.530 65.530 ↑ 1.2 8 6,553

Index Scan using routes_points_all_idx3 on routes_points_all rpa (cost=0.43..23.40 rows=10 width=21) (actual time=0.005..0.010 rows=8 loops=6,553)

  • Index Cond: ((route_id)::integer = (mcr.route_id)::integer)
49. 0.015 0.015 ↑ 333.3 3 1

Seq Scan on deliveries_cars_tasks_types dctt (cost=0.00..6.04 rows=1,000 width=8) (actual time=0.013..0.015 rows=3 loops=1)

  • Filter: (is_active IS NOT TRUE)
  • Rows Removed by Filter: 3
50. 0.002 0.002 ↑ 1.0 1 1

Seq Scan on deliveries_cars_tasks_types dctt_1 (cost=0.00..1.04 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=1)

  • Filter: (is_active IS NOT TRUE)
  • Rows Removed by Filter: 3
51. 1.232 1.232 ↓ 0.0 0 176

Index Scan using routes_points_backwards_idx on routes_points_backwards rpb (cost=0.29..10.40 rows=1 width=0) (actual time=0.007..0.007 rows=0 loops=176)

  • Index Cond: ((route_id)::integer = (r_4.id)::integer)
  • Filter: (((object_var)::text = 'contractor'::text) OR (requests_order_id IS NOT NULL))
  • Rows Removed by Filter: 3
52. 0.000 0.000 ↓ 0.0 0

Seq Scan on routes_points_backwards rpb_1 (cost=0.00..3,472.04 rows=2 width=4) (never executed)

  • Filter: (((object_var)::text = 'contractor'::text) OR (requests_order_id IS NOT NULL))
53. 32.016 32.016 ↑ 5.0 1 8,004

Index Scan using routes_points_manual_idx1 on routes_points_manual rpa_1 (cost=0.43..25.54 rows=5 width=0) (actual time=0.004..0.004 rows=1 loops=8,004)

  • Index Cond: ((route_id)::integer = (r_4.id)::integer)
  • Filter: ((object_var)::text = 'market'::text)
  • Rows Removed by Filter: 1
54. 0.000 0.000 ↓ 0.0 0

Seq Scan on routes_points_manual rpa_2 (cost=0.00..449,912.25 rows=3,237,620 width=4) (never executed)

  • Filter: ((object_var)::text = 'market'::text)
55.          

CTE route_passes

56. 0.010 23.147 ↓ 19.0 19 1

Unique (cost=10.56..10.57 rows=1 width=164) (actual time=23.139..23.147 rows=19 loops=1)

57. 0.036 23.137 ↓ 19.0 19 1

Sort (cost=10.56..10.57 rows=1 width=164) (actual time=23.135..23.137 rows=19 loops=1)

  • Sort Key: mcr_1.route_id
  • Sort Method: quicksort Memory: 26kB
58. 0.107 23.101 ↓ 19.0 19 1

Nested Loop (cost=10.50..10.55 rows=1 width=164) (actual time=3.257..23.101 rows=19 loops=1)

59. 1.980 1.980 ↓ 19.0 19 1

CTE Scan on meta_control_routes mcr_1 (cost=0.00..0.02 rows=1 width=8) (actual time=0.017..1.980 rows=19 loops=1)

  • Filter: with_psses
  • Rows Removed by Filter: 6,534
60. 20.767 21.014 ↑ 1.0 1 19

Function Scan on necessary_passes np (cost=10.50..10.51 rows=1 width=160) (actual time=1.106..1.106 rows=1 loops=19)

61.          

SubPlan (for Function Scan)

62. 0.076 0.247 ↑ 1.0 1 19

Aggregate (cost=10.24..10.25 rows=1 width=4) (actual time=0.013..0.013 rows=1 loops=19)

63. 0.171 0.171 ↑ 2.0 1 19

Index Only Scan using routes_drivers_idx on routes_drivers rd (cost=0.43..10.23 rows=2 width=4) (actual time=0.008..0.009 rows=1 loops=19)

  • Index Cond: (route_id = (mcr_1.route_id)::integer)
  • Heap Fetches: 21
64.          

CTE cr_rpa

65. 3.303 1,526.055 ↓ 6,553.0 6,553 1

Unique (cost=30.76..30.77 rows=1 width=468) (actual time=1,516.254..1,526.055 rows=6,553 loops=1)

66. 36.779 1,522.752 ↓ 16,440.7 49,322 1

Sort (cost=30.76..30.77 rows=3 width=468) (actual time=1,516.247..1,522.752 rows=49,322 loops=1)

  • Sort Key: cr2.route_id
  • Sort Method: quicksort Memory: 25,890kB
67. 55.083 1,485.973 ↓ 16,440.7 49,322 1

WindowAgg (cost=30.59..30.74 rows=3 width=468) (actual time=1,388.381..1,485.973 rows=49,322 loops=1)

68. 35.725 1,430.890 ↓ 16,440.7 49,322 1

WindowAgg (cost=30.59..30.67 rows=3 width=468) (actual time=1,388.323..1,430.890 rows=49,322 loops=1)

69. 67.167 1,395.165 ↓ 16,440.7 49,322 1

Sort (cost=30.59..30.59 rows=3 width=468) (actual time=1,388.294..1,395.165 rows=49,322 loops=1)

  • Sort Key: rpa_3.route_id, ((rpa_3.object_type = 'market'::text)) DESC, rpa_3.type_id DESC, rpa_3.order_num DESC
  • Sort Method: quicksort Memory: 27,655kB
70. 57.920 1,327.998 ↓ 16,440.7 49,322 1

WindowAgg (cost=30.48..30.56 rows=3 width=468) (actual time=1,261.099..1,327.998 rows=49,322 loops=1)

71. 101.824 1,270.078 ↓ 16,440.7 49,322 1

Sort (cost=30.48..30.49 rows=3 width=468) (actual time=1,261.054..1,270.078 rows=49,322 loops=1)

  • Sort Key: rpa_3.route_id, rpa_3.type_id DESC, rpa_3.order_num DESC
  • Sort Method: quicksort Memory: 26,227kB
72. 22.610 1,168.254 ↓ 16,440.7 49,322 1

Nested Loop Left Join (cost=0.87..30.46 rows=3 width=468) (actual time=144.784..1,168.254 rows=49,322 loops=1)

73. 922.842 922.842 ↓ 6,553.0 6,553 1

CTE Scan on controled_routes cr2 (cost=0.00..0.02 rows=1 width=410) (actual time=144.766..922.842 rows=6,553 loops=1)

74. 41.666 222.802 ↓ 4.0 8 6,553

Nested Loop (cost=0.87..30.42 rows=2 width=58) (actual time=0.007..0.034 rows=8 loops=6,553)

75. 32.765 32.765 ↑ 1.2 8 6,553

Index Scan using routes_points_all_idx3 on routes_points_all rpa_3 (cost=0.43..23.40 rows=10 width=59) (actual time=0.003..0.005 rows=8 loops=6,553)

  • Index Cond: ((route_id)::integer = (cr2.route_id)::integer)
76. 148.371 148.371 ↑ 1.0 1 49,457

Index Scan using routes_pkey on routes r_5 (cost=0.43..0.69 rows=1 width=9) (actual time=0.003..0.003 rows=1 loops=49,457)

  • Index Cond: ((id)::integer = (rpa_3.route_id)::integer)
  • Filter: ((COALESCE(rpa_3.open_route_point, false) = COALESCE(opened, false)) AND CASE WHEN (routes_type_transits IS NOT NULL) THEN ((rpa_3.type_id)::integer = ANY ('{3,4}'::integer[])) WHEN (routes_type = 0) THEN ((rpa_3.type_id)::integer = ANY ('{1,4}'::integer[])) WHEN (routes_type = 1) THEN ((rpa_3.type_id)::integer = ANY ('{2,4}'::integer[])) ELSE false END)
  • Rows Removed by Filter: 0
77. 9.125 2,664.007 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,810.84..20,338.14 rows=1 width=1,681) (actual time=1,636.580..2,664.007 rows=6,553 loops=1)

  • Join Filter: (r.scheme_id = rs.id)
  • Rows Removed by Join Filter: 19,609
78. 4.929 2,648.329 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,810.84..20,337.07 rows=1 width=1,672) (actual time=1,636.559..2,648.329 rows=6,553 loops=1)

79. 8.070 2,630.294 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,810.42..20,336.62 rows=1 width=1,609) (actual time=1,636.537..2,630.294 rows=6,553 loops=1)

  • Join Filter: cr_rpa.is_transit
  • Rows Removed by Join Filter: 9
80. 31.168 2,609.118 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,810.00..20,336.17 rows=1 width=1,538) (actual time=1,636.501..2,609.118 rows=6,553 loops=1)

  • Join Filter: ((frs.is_opened = COALESCE(r.opened, false)) AND (frs.is_auto_open = r.auto_open) AND (frs.has_future_route = (haor.auto_open_route_id IS NOT NULL)) AND (frs.open_type = COALESCE(ref.status_future_route_opened, '-1'::integer)))
  • Rows Removed by Join Filter: 51,784
81. 13.464 2,571.397 ↓ 6,553.0 6,553 1

Hash Left Join (cost=6,810.00..20,334.93 rows=1 width=1,541) (actual time=1,636.467..2,571.397 rows=6,553 loops=1)

  • Hash Cond: ((COALESCE(r.opened, false) = ors.is_opened) AND (ref.auto_open_rc = ors.is_auto_open) AND (COALESCE((r.route_status = 1), false) = ors.is_finished) AND (COALESCE((r.open_type)::integer, '-1'::integer) = ors.open_type))
82. 2.573 2,557.902 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,808.61..20,333.49 rows=1 width=1,544) (actual time=1,636.393..2,557.902 rows=6,553 loops=1)

  • Join Filter: cr_rpa.is_transit
83. 4.422 2,535.670 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,808.18..20,333.04 rows=1 width=1,527) (actual time=1,636.367..2,535.670 rows=6,553 loops=1)

84. 4.049 2,518.142 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,807.75..20,332.47 rows=1 width=1,525) (actual time=1,636.344..2,518.142 rows=6,553 loops=1)

85. 5.111 2,487.881 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,807.31..20,331.90 rows=1 width=1,523) (actual time=1,636.315..2,487.881 rows=6,553 loops=1)

86. 6.104 2,482.770 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,807.18..20,331.74 rows=1 width=1,486) (actual time=1,636.301..2,482.770 rows=6,553 loops=1)

87. 5.459 2,450.454 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,806.75..20,331.24 rows=1 width=1,481) (actual time=1,636.272..2,450.454 rows=6,553 loops=1)

88. 5.127 2,386.018 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,805.93..20,330.24 rows=1 width=1,413) (actual time=1,636.193..2,386.018 rows=6,553 loops=1)

89. 4.850 2,380.891 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,805.65..20,328.61 rows=1 width=1,367) (actual time=1,636.174..2,380.891 rows=6,553 loops=1)

90. 5.136 2,376.041 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,805.50..20,328.36 rows=1 width=1,367) (actual time=1,636.160..2,376.041 rows=6,553 loops=1)

91. 2.857 2,370.905 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,805.35..20,328.18 rows=1 width=1,367) (actual time=1,636.131..2,370.905 rows=6,553 loops=1)

92. 6.579 2,354.942 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,805.07..20,326.55 rows=1 width=1,321) (actual time=1,636.098..2,354.942 rows=6,553 loops=1)

93. 6.600 2,341.810 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,804.92..20,326.30 rows=1 width=1,321) (actual time=1,636.068..2,341.810 rows=6,553 loops=1)

94. 5.040 2,328.657 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,804.78..20,326.12 rows=1 width=1,321) (actual time=1,636.037..2,328.657 rows=6,553 loops=1)

95. 2.063 2,323.617 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,804.64..20,325.96 rows=1 width=1,299) (actual time=1,636.022..2,323.617 rows=6,553 loops=1)

96. 3.066 2,308.448 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,804.35..20,325.61 rows=1 width=1,231) (actual time=1,635.992..2,308.448 rows=6,553 loops=1)

97. 4.610 2,292.276 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,804.06..20,325.09 rows=1 width=1,215) (actual time=1,635.965..2,292.276 rows=6,553 loops=1)

98. 5.816 2,268.007 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,803.78..20,324.57 rows=1 width=1,207) (actual time=1,635.927..2,268.007 rows=6,553 loops=1)

99. 8.076 2,255.638 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,803.64..20,324.41 rows=1 width=1,209) (actual time=1,635.897..2,255.638 rows=6,553 loops=1)

100. 7.061 2,241.009 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,803.50..20,324.25 rows=1 width=1,211) (actual time=1,635.866..2,241.009 rows=6,553 loops=1)

101. 9.141 2,227.395 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,803.23..20,323.94 rows=1 width=1,207) (actual time=1,635.836..2,227.395 rows=6,553 loops=1)

102. 4.462 2,192.042 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,802.80..20,323.40 rows=1 width=1,184) (actual time=1,635.798..2,192.042 rows=6,553 loops=1)

103. 7.940 2,181.027 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,802.67..20,323.24 rows=1 width=1,160) (actual time=1,635.773..2,181.027 rows=6,553 loops=1)

104. 5.755 2,166.534 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,802.38..20,322.92 rows=1 width=1,156) (actual time=1,635.743..2,166.534 rows=6,553 loops=1)

105. 4.573 2,141.120 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,802.10..20,322.38 rows=1 width=1,155) (actual time=1,635.707..2,141.120 rows=6,553 loops=1)

106. 2.613 2,116.888 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,801.81..20,322.05 rows=1 width=1,155) (actual time=1,635.666..2,116.888 rows=6,553 loops=1)

107. 5.338 2,101.169 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,801.53..20,321.74 rows=1 width=1,145) (actual time=1,635.642..2,101.169 rows=6,553 loops=1)

108. 2.991 2,089.278 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,801.40..20,321.58 rows=1 width=1,138) (actual time=1,635.611..2,089.278 rows=6,553 loops=1)

109. 5.315 2,079.734 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,801.26..20,321.41 rows=1 width=1,123) (actual time=1,635.582..2,079.734 rows=6,553 loops=1)

110. 8.939 2,067.866 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,801.12..20,321.24 rows=1 width=1,103) (actual time=1,635.545..2,067.866 rows=6,553 loops=1)

111. 3.113 2,039.268 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,800.70..20,320.53 rows=1 width=1,087) (actual time=1,635.488..2,039.268 rows=6,553 loops=1)

112. 24.464 2,009.943 ↓ 6,553.0 6,553 1

Hash Join (cost=6,800.41..20,320.22 rows=1 width=1,083) (actual time=1,635.432..2,009.943 rows=6,553 loops=1)

  • Hash Cond: ((c.id)::integer = (r.car_id)::integer)
113. 51.200 407.238 ↑ 1.0 88,599 1

Hash Left Join (cost=6,791.59..19,979.14 rows=88,599 width=354) (actual time=57.128..407.238 rows=88,599 loops=1)

  • Hash Cond: (((CASE WHEN ((cs.state_car)::integer = 12) THEN 12 WHEN ((ts.state_trailer)::integer = 12) THEN 34 WHEN ((cs.state_car)::integer = 33) THEN 33 WHEN ((ts.state_trailer)::integer = 33) THEN 35 ELSE (cs.state_car)::integer END)::identifier)::integer = (vst2.id)::integer)
114. 13.924 356.016 ↑ 1.0 88,599 1

Nested Loop (cost=6,789.78..19,042.61 rows=88,599 width=325) (actual time=57.057..356.016 rows=88,599 loops=1)

115. 0.083 0.096 ↑ 1.0 1 1

Aggregate (cost=1.54..1.56 rows=1 width=37) (actual time=0.096..0.096 rows=1 loops=1)

116. 0.013 0.013 ↑ 1.0 36 1

Seq Scan on vehicles_statuses_types vst (cost=0.00..1.36 rows=36 width=37) (actual time=0.010..0.013 rows=36 loops=1)

117. 22.119 341.996 ↑ 1.0 88,599 1

Hash Left Join (cost=6,788.24..18,155.05 rows=88,599 width=293) (actual time=56.827..341.996 rows=88,599 loops=1)

  • Hash Cond: ((c.trailer_id)::integer = (ts.trailer_id)::integer)
118. 46.487 315.508 ↑ 1.0 88,599 1

Hash Join (cost=6,225.14..17,060.10 rows=88,599 width=289) (actual time=52.324..315.508 rows=88,599 loops=1)

  • Hash Cond: ((c.id)::integer = (cs.car_id)::integer)
119. 17.704 244.425 ↑ 1.0 88,599 1

Hash Left Join (cost=3,610.66..13,227.39 rows=88,599 width=265) (actual time=27.260..244.425 rows=88,599 loops=1)

  • Hash Cond: ((c.gps_device_id)::integer = (rusc.gps_device_id)::integer)
120. 22.453 224.344 ↑ 1.0 88,599 1

Hash Left Join (cost=3,186.75..12,398.44 rows=88,599 width=255) (actual time=24.835..224.344 rows=88,599 loops=1)

  • Hash Cond: ((c.warm_type_id)::integer = (wt_c.id)::integer)
121. 15.631 201.876 ↑ 1.0 88,599 1

Hash Left Join (cost=3,185.61..11,179.07 rows=88,599 width=248) (actual time=24.798..201.876 rows=88,599 loops=1)

  • Hash Cond: (c.temperature_sensor_model_id = tsm_c.id)
122. 14.455 186.231 ↑ 1.0 88,599 1

Hash Left Join (cost=3,184.10..10,821.84 rows=88,599 width=233) (actual time=24.764..186.231 rows=88,599 loops=1)

  • Hash Cond: ((c.autocades_id)::integer = (a.id)::integer)
123. 24.975 171.663 ↑ 1.0 88,599 1

Hash Left Join (cost=3,168.19..10,406.14 rows=88,599 width=228) (actual time=24.632..171.663 rows=88,599 loops=1)

  • Hash Cond: ((c.company_owner_id)::integer = (c_cto.id)::integer)
124. 17.737 146.231 ↑ 1.0 88,599 1

Hash Left Join (cost=3,092.60..9,112.32 rows=88,599 width=190) (actual time=24.154..146.231 rows=88,599 loops=1)

  • Hash Cond: ((c.car_trailer_brand_id)::integer = ctb_c.id)
125. 21.397 128.424 ↑ 1.0 88,599 1

Hash Left Join (cost=3,084.82..8,439.02 rows=88,599 width=170) (actual time=24.065..128.424 rows=88,599 loops=1)

  • Hash Cond: ((c.id)::integer = (cg.car_id)::integer)
126. 22.691 102.981 ↑ 1.0 88,599 1

Hash Left Join (cost=2,290.42..7,182.87 rows=88,599 width=162) (actual time=19.941..102.981 rows=88,599 loops=1)

  • Hash Cond: ((c.type_delivery)::integer = dtt.id)
127. 44.307 80.271 ↑ 1.0 88,599 1

Hash Left Join (cost=2,289.27..5,963.47 rows=88,599 width=149) (actual time=19.907..80.271 rows=88,599 loops=1)

  • Hash Cond: ((c.phone_id)::integer = (ph.id)::integer)
128. 16.148 16.148 ↑ 1.0 88,599 1

Seq Scan on cars c (cost=0.00..3,292.99 rows=88,599 width=133) (actual time=0.004..16.148 rows=88,599 loops=1)

129. 1.467 19.816 ↑ 1.0 11,244 1

Hash (cost=2,148.72..2,148.72 rows=11,244 width=28) (actual time=19.816..19.816 rows=11,244 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 648kB
130. 1.484 18.349 ↑ 1.0 11,244 1

Hash Left Join (cost=1,321.75..2,148.72 rows=11,244 width=28) (actual time=10.887..18.349 rows=11,244 loops=1)

  • Hash Cond: ((ph.simcard_abroad_id)::integer = (sim_abroad.id)::integer)
131. 4.365 9.127 ↑ 1.0 11,244 1

Hash Right Join (cost=362.99..1,146.73 rows=11,244 width=20) (actual time=3.031..9.127 rows=11,244 loops=1)

  • Hash Cond: ((sim.id)::integer = (ph.simcard_id)::integer)
132. 1.830 1.830 ↑ 1.0 31,056 1

Seq Scan on simcards sim (cost=0.00..570.56 rows=31,056 width=16) (actual time=0.020..1.830 rows=31,056 loops=1)

133. 1.294 2.932 ↑ 1.0 11,244 1

Hash (cost=222.44..222.44 rows=11,244 width=12) (actual time=2.932..2.932 rows=11,244 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 562kB
134. 1.638 1.638 ↑ 1.0 11,244 1

Seq Scan on phones ph (cost=0.00..222.44 rows=11,244 width=12) (actual time=0.010..1.638 rows=11,244 loops=1)

135. 4.002 7.738 ↑ 1.0 31,056 1

Hash (cost=570.56..570.56 rows=31,056 width=16) (actual time=7.738..7.738 rows=31,056 loops=1)

  • Buckets: 32,768 Batches: 1 Memory Usage: 1,833kB
136. 3.736 3.736 ↑ 1.0 31,056 1

Seq Scan on simcards sim_abroad (cost=0.00..570.56 rows=31,056 width=16) (actual time=0.003..3.736 rows=31,056 loops=1)

137. 0.006 0.019 ↑ 1.0 7 1

Hash (cost=1.07..1.07 rows=7 width=21) (actual time=0.019..0.019 rows=7 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
138. 0.013 0.013 ↑ 1.0 7 1

Seq Scan on deliveries_types dtt (cost=0.00..1.07 rows=7 width=21) (actual time=0.011..0.013 rows=7 loops=1)

139. 1.531 4.046 ↑ 1.0 12,951 1

Hash (cost=632.51..632.51 rows=12,951 width=12) (actual time=4.046..4.046 rows=12,951 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 662kB
140. 2.515 2.515 ↑ 1.0 12,951 1

Seq Scan on cars_gps cg (cost=0.00..632.51 rows=12,951 width=12) (actual time=0.009..2.515 rows=12,951 loops=1)

141. 0.040 0.070 ↑ 1.0 168 1

Hash (cost=5.68..5.68 rows=168 width=28) (actual time=0.070..0.070 rows=168 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 19kB
142. 0.030 0.030 ↑ 1.0 168 1

Seq Scan on cars_trailers_brands ctb_c (cost=0.00..5.68 rows=168 width=28) (actual time=0.005..0.030 rows=168 loops=1)

143. 0.215 0.457 ↑ 1.0 1,226 1

Hash (cost=60.26..60.26 rows=1,226 width=46) (actual time=0.457..0.457 rows=1,226 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 113kB
144. 0.242 0.242 ↑ 1.0 1,226 1

Seq Scan on cars_trailers_owners c_cto (cost=0.00..60.26 rows=1,226 width=46) (actual time=0.005..0.242 rows=1,226 loops=1)

145. 0.059 0.113 ↑ 1.0 396 1

Hash (cost=10.96..10.96 rows=396 width=13) (actual time=0.113..0.113 rows=396 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 26kB
146. 0.054 0.054 ↑ 1.0 396 1

Seq Scan on autocades a (cost=0.00..10.96 rows=396 width=13) (actual time=0.006..0.054 rows=396 loops=1)

147. 0.009 0.014 ↑ 1.0 23 1

Hash (cost=1.23..1.23 rows=23 width=23) (actual time=0.014..0.014 rows=23 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
148. 0.005 0.005 ↑ 1.0 23 1

Seq Scan on temperature_sensor_models tsm_c (cost=0.00..1.23 rows=23 width=23) (actual time=0.003..0.005 rows=23 loops=1)

149. 0.011 0.015 ↑ 1.0 6 1

Hash (cost=1.06..1.06 rows=6 width=15) (actual time=0.015..0.015 rows=6 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
150. 0.004 0.004 ↑ 1.0 6 1

Seq Scan on warm_types wt_c (cost=0.00..1.06 rows=6 width=15) (actual time=0.004..0.004 rows=6 loops=1)

151. 1.031 2.377 ↑ 1.0 8,085 1

Hash (cost=322.85..322.85 rows=8,085 width=14) (actual time=2.377..2.377 rows=8,085 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 423kB
152. 1.346 1.346 ↑ 1.0 8,085 1

Seq Scan on refrigeration_unit_status rusc (cost=0.00..322.85 rows=8,085 width=14) (actual time=0.003..1.346 rows=8,085 loops=1)

153. 12.974 24.596 ↑ 1.0 88,599 1

Hash (cost=1,506.99..1,506.99 rows=88,599 width=24) (actual time=24.596..24.596 rows=88,599 loops=1)

  • Buckets: 131,072 Batches: 1 Memory Usage: 5,089kB
154. 11.622 11.622 ↑ 1.0 88,599 1

Seq Scan on cars_statuses cs (cost=0.00..1,506.99 rows=88,599 width=24) (actual time=0.011..11.622 rows=88,599 loops=1)

155. 2.338 4.369 ↑ 1.0 19,960 1

Hash (cost=313.60..313.60 rows=19,960 width=8) (actual time=4.369..4.369 rows=19,960 loops=1)

  • Buckets: 32,768 Batches: 1 Memory Usage: 1,036kB
156. 2.031 2.031 ↑ 1.0 19,960 1

Seq Scan on trailers_statuses ts (cost=0.00..313.60 rows=19,960 width=8) (actual time=0.009..2.031 rows=19,960 loops=1)

157. 0.018 0.022 ↑ 1.0 36 1

Hash (cost=1.36..1.36 rows=36 width=37) (actual time=0.022..0.022 rows=36 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 11kB
158. 0.004 0.004 ↑ 1.0 36 1

Seq Scan on vehicles_statuses_types vst2 (cost=0.00..1.36 rows=36 width=37) (actual time=0.004..0.004 rows=36 loops=1)

159. 7.603 1,578.241 ↓ 6,553.0 6,553 1

Hash (cost=8.81..8.81 rows=1 width=737) (actual time=1,578.241..1,578.241 rows=6,553 loops=1)

  • Buckets: 8,192 (originally 1024) Batches: 1 (originally 1) Memory Usage: 3,282kB
160. 5.615 1,570.638 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=0.70..8.81 rows=1 width=737) (actual time=1,516.472..1,570.638 rows=6,553 loops=1)

  • Join Filter: (r.opened IS TRUE)
161. 5.322 1,565.023 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=0.57..8.65 rows=1 width=692) (actual time=1,516.421..1,565.023 rows=6,553 loops=1)

162. 10.250 1,559.701 ↓ 6,553.0 6,553 1

Nested Loop (cost=0.43..8.48 rows=1 width=649) (actual time=1,516.358..1,559.701 rows=6,553 loops=1)

163. 1,529.792 1,529.792 ↓ 6,553.0 6,553 1

CTE Scan on cr_rpa (cost=0.00..0.02 rows=1 width=310) (actual time=1,516.280..1,529.792 rows=6,553 loops=1)

164. 19.659 19.659 ↑ 1.0 1 6,553

Index Scan using routes_pkey on routes r (cost=0.43..8.45 rows=1 width=339) (actual time=0.003..0.003 rows=1 loops=6,553)

  • Index Cond: ((id)::integer = (cr_rpa.route_id)::integer)
165. 0.000 0.000 ↓ 0.0 0 6,553

Index Scan using delivery_acception_statuses_pkey on delivery_acception_statuses das (cost=0.14..0.16 rows=1 width=52) (actual time=0.000..0.000 rows=0 loops=6,553)

  • Index Cond: (id = r.delivery_acception_status)
  • Filter: (accepted = r.general_delivery_acception)
166. 0.000 0.000 ↓ 0.0 0 6,553

Index Scan using route_acception_statuses_pkey on route_acception_statuses ras (cost=0.13..0.15 rows=1 width=49) (actual time=0.000..0.000 rows=0 loops=6,553)

  • Index Cond: (id = r.route_acception_status)
  • Filter: (NOT (accepted IS DISTINCT FROM r.general_route_acception))
  • Rows Removed by Filter: 0
167. 26.212 26.212 ↑ 1.0 1 6,553

Index Scan using arm_de_tablet_car_id_idx on tablet de_t (cost=0.28..0.30 rows=1 width=8) (actual time=0.003..0.004 rows=1 loops=6,553)

  • Index Cond: ((car_id)::integer = (c.id)::integer)
168. 19.659 19.659 ↑ 1.0 1 6,553

Index Scan using trailers_pkey on trailers t (cost=0.42..0.70 rows=1 width=20) (actual time=0.003..0.003 rows=1 loops=6,553)

  • Index Cond: ((id)::integer = (c.trailer_id)::integer)
169. 6.553 6.553 ↑ 1.0 1 6,553

Index Scan using pk_cars_trailers_brands on cars_trailers_brands ctb_t (cost=0.14..0.16 rows=1 width=28) (actual time=0.001..0.001 rows=1 loops=6,553)

  • Index Cond: (id = (t.car_trailer_brand_id)::integer)
170. 6.553 6.553 ↑ 1.0 1 6,553

Index Scan using temperature_sensor_models_pkey on temperature_sensor_models tsm_t (cost=0.14..0.16 rows=1 width=23) (actual time=0.001..0.001 rows=1 loops=6,553)

  • Index Cond: (t.temperature_sensor_model_id = id)
171. 6.553 6.553 ↑ 1.0 1 6,553

Index Scan using warm_types_pkey on warm_types wt_t (cost=0.13..0.15 rows=1 width=15) (actual time=0.001..0.001 rows=1 loops=6,553)

  • Index Cond: ((id)::integer = (t.warm_type_id)::integer)
172. 13.106 13.106 ↑ 1.0 1 6,553

Index Scan using refrigeration_unit_status_pkey on refrigeration_unit_status rust (cost=0.28..0.30 rows=1 width=14) (actual time=0.002..0.002 rows=1 loops=6,553)

  • Index Cond: ((gps_device_id)::integer = (t.gps_device_id)::integer)
173. 19.659 19.659 ↑ 1.0 1 6,553

Index Only Scan using gps_devices_pkey on gps_devices gdc (cost=0.29..0.31 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=6,553)

  • Index Cond: (id = (c.gps_device_id)::integer)
  • Heap Fetches: 6,505
174. 19.659 19.659 ↑ 1.0 1 6,553

Index Scan using gps_devices_extra_fields2_pkey on gps_devices_extra_fields2 ef2 (cost=0.29..0.54 rows=1 width=5) (actual time=0.003..0.003 rows=1 loops=6,553)

  • Index Cond: ((gps_device_id)::integer = (gdc.id)::integer)
175. 6.553 6.553 ↑ 1.0 1 6,553

Index Scan using gps_devices_pkey on gps_devices gdt (cost=0.29..0.31 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=6,553)

  • Index Cond: ((id)::integer = (t.gps_device_id)::integer)
176. 6.553 6.553 ↑ 1.0 1 6,553

Index Scan using gps_devices_models_pkey on gps_devices_models gdmt (cost=0.13..0.15 rows=1 width=32) (actual time=0.001..0.001 rows=1 loops=6,553)

  • Index Cond: ((id)::integer = (gdt.gps_devices_model_id)::integer)
177. 26.212 26.212 ↑ 1.0 1 6,553

Index Scan using routes_extra_fields_idx on routes_extra_fields ref (cost=0.43..0.54 rows=1 width=27) (actual time=0.004..0.004 rows=1 loops=6,553)

  • Index Cond: ((route_id)::integer = (r.id)::integer)
178. 6.553 6.553 ↓ 0.0 0 6,553

Index Scan using history_auto_open_routes_idx on history_auto_open_routes haor (cost=0.27..0.29 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=6,553)

  • Index Cond: ((route_id)::integer = (r.id)::integer)
  • Filter: (auto_open_type_id = 1)
179. 6.553 6.553 ↑ 1.0 1 6,553

Index Scan using cars_models_pkey on cars_models cm (cost=0.14..0.16 rows=1 width=6) (actual time=0.001..0.001 rows=1 loops=6,553)

  • Index Cond: ((id)::integer = (r.car_model_id)::integer)
180. 6.553 6.553 ↑ 1.0 1 6,553

Index Scan using trailers_models_pkey on trailers_models tm (cost=0.14..0.15 rows=1 width=6) (actual time=0.001..0.001 rows=1 loops=6,553)

  • Index Cond: ((id)::integer = (r.trailer_model_id)::integer)
181. 19.659 19.659 ↑ 1.0 1 6,553

Index Scan using malfunction_extra_fields_pkey on malfunction_extra_fields mefc (cost=0.29..0.51 rows=1 width=16) (actual time=0.002..0.003 rows=1 loops=6,553)

  • Index Cond: (gps_device_id = (gdc.id)::integer)
182. 13.106 13.106 ↑ 1.0 1 6,553

Index Scan using malfunction_extra_fields_pkey on malfunction_extra_fields meft (cost=0.29..0.51 rows=1 width=24) (actual time=0.001..0.002 rows=1 loops=6,553)

  • Index Cond: (gps_device_id = (gdt.id)::integer)
183. 13.106 13.106 ↓ 0.0 0 6,553

Index Scan using cch_route_idx on car_comments_history cch (cost=0.29..0.33 rows=2 width=72) (actual time=0.002..0.002 rows=0 loops=6,553)

  • Index Cond: (route_id = (r.id)::integer)
184. 0.000 0.000 ↓ 0.0 0 6,553

Index Scan using car_comment_templates_pkey on car_comment_templates cct (cost=0.14..0.16 rows=1 width=30) (actual time=0.000..0.000 rows=0 loops=6,553)

  • Index Cond: (id = cch.comment_template)
185. 6.553 6.553 ↑ 1.0 1 6,553

Index Scan using autocades_pkey on autocades native_autocade (cost=0.15..0.17 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=6,553)

  • Index Cond: ((id)::integer = (c.autocades_id)::integer)
186. 6.553 6.553 ↑ 1.0 1 6,553

Index Scan using autocades_managers_pkey on autocades_managers native_manager (cost=0.15..0.25 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=6,553)

  • Index Cond: ((id)::integer = (native_autocade.autocades_managers_id)::integer)
187. 13.106 13.106 ↑ 1.0 1 6,553

Index Scan using users2_pkey on users native_user (cost=0.28..1.62 rows=1 width=54) (actual time=0.001..0.002 rows=1 loops=6,553)

  • Index Cond: (user_oid = (native_manager.user_oid)::oid)
188. 0.000 0.000 ↓ 0.0 0 6,553

Index Scan using autocades_pkey on autocades prikom_ak (cost=0.15..0.17 rows=1 width=8) (actual time=0.000..0.000 rows=0 loops=6,553)

  • Index Cond: ((id)::integer = (c.receiver_autocade_id)::integer)
189. 0.000 0.000 ↓ 0.0 0 6,553

Index Scan using autocades_managers_pkey on autocades_managers am_prikom (cost=0.15..0.25 rows=1 width=8) (actual time=0.000..0.000 rows=0 loops=6,553)

  • Index Cond: ((id)::integer = (prikom_ak.autocades_managers_id)::integer)
190. 0.000 0.000 ↓ 0.0 0 6,553

Index Scan using users2_pkey on users am_prikom_u (cost=0.28..1.62 rows=1 width=54) (actual time=0.000..0.000 rows=0 loops=6,553)

  • Index Cond: (user_oid = (am_prikom.user_oid)::oid)
191. 6.553 58.977 ↑ 1.0 1 6,553

Nested Loop Left Join (cost=0.82..0.99 rows=1 width=72) (actual time=0.008..0.009 rows=1 loops=6,553)

192. 6.553 52.424 ↑ 1.0 1 6,553

Nested Loop Left Join (cost=0.69..0.84 rows=1 width=39) (actual time=0.007..0.008 rows=1 loops=6,553)

193. 6.553 45.871 ↑ 1.0 1 6,553

Nested Loop (cost=0.56..0.68 rows=1 width=15) (actual time=0.006..0.007 rows=1 loops=6,553)

194. 26.212 26.212 ↑ 1.0 1 6,553

Index Scan using route_pkey on route r_1 (cost=0.43..0.52 rows=1 width=19) (actual time=0.004..0.004 rows=1 loops=6,553)

  • Index Cond: ((route_id)::integer = (r.id)::integer)
195. 13.106 13.106 ↑ 1.0 1 6,553

Index Only Scan using route_state_pkey on route_state (cost=0.13..0.15 rows=1 width=4) (actual time=0.001..0.002 rows=1 loops=6,553)

  • Index Cond: (id = (r_1.state_id)::integer)
  • Heap Fetches: 6,553
196. 0.000 0.000 ↓ 0.0 0 6,553

Index Scan using event_delivery_cause_pkey on event_delivery_cause edc (cost=0.13..0.15 rows=1 width=32) (actual time=0.000..0.000 rows=0 loops=6,553)

  • Index Cond: ((id)::integer = (r_1.delivery_cause_id)::integer)
197. 0.000 0.000 ↓ 0.0 0 6,553

Index Scan using event_route_cause_pkey on event_route_cause rc (cost=0.13..0.15 rows=1 width=41) (actual time=0.000..0.000 rows=0 loops=6,553)

  • Index Cond: ((id)::integer = (r_1.route_cause_id)::integer)
198. 26.212 26.212 ↑ 1.0 1 6,553

Index Scan using route_backward_pkey on route_backward de_rb (cost=0.43..0.49 rows=1 width=9) (actual time=0.004..0.004 rows=1 loops=6,553)

  • Index Cond: ((route_id)::integer = (r.id)::integer)
199. 0.000 0.000 ↓ 0.0 0 6,553

Index Scan using event_route_cause_pkey on event_route_cause de_erc (cost=0.13..0.15 rows=1 width=41) (actual time=0.000..0.000 rows=0 loops=6,553)

  • Index Cond: ((id)::integer = (de_rb.cancel_cause_id)::integer)
200. 26.212 26.212 ↑ 1.0 1 6,553

Index Scan using routes_dc_times_detail_idx on routes_dc_times_detail park0 (cost=0.43..0.56 rows=1 width=6) (actual time=0.003..0.004 rows=1 loops=6,553)

  • Index Cond: (((route_id)::integer = (r.id)::integer) AND (tr_type = 0))
201. 13.106 13.106 ↓ 0.0 0 6,553

Index Scan using routes_dc_times_detail_idx on routes_dc_times_detail park1 (cost=0.43..0.56 rows=1 width=6) (actual time=0.002..0.002 rows=0 loops=6,553)

  • Index Cond: (((route_id)::integer = (r.id)::integer) AND (tr_type = 1))
202. 19.659 19.659 ↓ 0.0 0 6,553

Index Scan using routes_imp_extra_fields_route_id_key on routes_imp_extra_fields rief (cost=0.42..0.45 rows=1 width=21) (actual time=0.002..0.003 rows=0 loops=6,553)

  • Index Cond: ((route_id)::integer = (r.id)::integer)
203. 0.026 0.031 ↑ 1.0 13 1

Hash (cost=1.13..1.13 rows=13 width=7) (actual time=0.031..0.031 rows=13 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
204. 0.005 0.005 ↑ 1.0 13 1

Seq Scan on open_route_statuses ors (cost=0.00..1.13 rows=13 width=7) (actual time=0.004..0.005 rows=13 loops=1)

205. 6.553 6.553 ↑ 1.0 8 6,553

Seq Scan on future_route_statuses frs (cost=0.00..1.08 rows=8 width=7) (actual time=0.001..0.001 rows=8 loops=6,553)

206. 13.106 13.106 ↓ 0.0 0 6,553

Index Scan using route_id on escalation_answers ea (cost=0.42..0.44 rows=1 width=75) (actual time=0.002..0.002 rows=0 loops=6,553)

  • Index Cond: (route_id = (r.id)::integer)
207. 13.106 13.106 ↓ 0.0 0 6,553

Index Scan using escalation_answers_route_pkey on escalation_answers_route ear (cost=0.42..0.44 rows=1 width=67) (actual time=0.002..0.002 rows=0 loops=6,553)

  • Index Cond: (route_id = (r.id)::integer)
208. 6.553 6.553 ↑ 1.0 3 6,553

Seq Scan on routes_schemes rs (cost=0.00..1.03 rows=3 width=17) (actual time=0.001..0.001 rows=3 loops=6,553)

209. 32.765 32.765 ↓ 19.0 19 6,553

CTE Scan on route_passes rp (cost=0.00..0.02 rows=1 width=69) (actual time=0.004..0.005 rows=19 loops=6,553)

210.          

SubPlan (for Nested Loop Left Join)

211. 19.659 19.659 ↓ 0.0 0 6,553

Index Only Scan using open_routes_change_sessions_route_state on open_routes_change_sessions orcs (cost=0.42..8.45 rows=1 width=0) (actual time=0.003..0.003 rows=0 loops=6,553)

  • Index Cond: ((state = 0) AND (route_id = (r.id)::integer))
  • Heap Fetches: 0
212. 0.000 0.000 ↓ 0.0 0

Index Only Scan using open_routes_change_sessions_route_state on open_routes_change_sessions orcs_1 (cost=0.42..8.44 rows=1 width=4) (never executed)

  • Index Cond: (state = 0)
  • Heap Fetches: 0
213. 0.000 0.000 ↓ 0.0 0 6,553

Index Scan using cars_trailers_owners_pkey on cars_trailers_owners cto_1 (cost=0.28..8.29 rows=1 width=42) (actual time=0.000..0.000 rows=0 loops=6,553)

  • Index Cond: ((id)::integer = ref.open_receiver_owner_id)
214. 0.000 0.000 ↓ 0.0 0 6,553

Index Scan using autocades_pkey on autocades au (cost=0.15..8.17 rows=1 width=5) (actual time=0.000..0.000 rows=0 loops=6,553)

  • Index Cond: ((id)::integer = ref.open_receiver_autocade_id)
Planning time : 42.469 ms
Execution time : 4,748.971 ms