explain.depesz.com

PostgreSQL's explain analyze made readable

Result: epho

Settings
# exclusive inclusive rows x rows loops node
1. 2,035.020 7,733.910 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=49,322.86..62,875.47 rows=1 width=1,659) (actual time=4,612.848..7,733.910 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. 90.745 471.623 ↓ 6,553.0 6,553 1

GroupAggregate (cost=41,913.66..42,398.54 rows=1 width=174) (actual time=198.937..471.623 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. 17.077 206.654 ↓ 6,754.0 6,754 1

Sort (cost=41,913.66..41,913.67 rows=1 width=174) (actual time=198.868..206.654 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. 37.391 189.577 ↓ 6,754.0 6,754 1

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

6. 5.406 119.406 ↓ 6,556.0 6,556 1

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

7. 9.774 100.886 ↓ 6,557.0 6,557 1

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

8. 19.303 54.387 ↓ 1.1 7,345 1

Hash Join (cost=75.58..4,200.01 rows=6,497 width=9) (actual time=0.597..54.387 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. 34.536 34.536 ↑ 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..34.536 rows=60,468 loops=1)

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

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

  • Buckets: 2,048 Batches: 1 Memory Usage: 64kB
11. 0.366 0.366 ↑ 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.004..0.366 rows=1,226 loops=1)

12. 36.725 36.725 ↑ 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.005..0.005 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. 32.780 32.780 ↑ 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.005..0.005 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. 0.000 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. 13.106 52.424 ↓ 0.0 0 6,553

Sort (cost=456.53..456.81 rows=113 width=16) (actual time=0.008..0.008 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. 34.608 121.800 ↓ 0.0 0 4,872

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

  • Hash Cond: (mp.market_id = (rpm.object_id)::integer)
20. 18.984 18.984 ↑ 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.006 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. 2,902.198 3,898.100 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=14.75..72.13 rows=1 width=197) (actual time=205.751..3,898.100 rows=6,553 loops=1)

29. 71.497 753.441 ↓ 6,553.0 6,553 1

Hash Left Join (cost=14.31..30.55 rows=1 width=173) (actual time=199.106..753.441 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)
30. 13.700 648.843 ↓ 6,553.0 6,553 1

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

31. 4.159 563.060 ↓ 6,553.0 6,553 1

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

32. 7.253 552.348 ↓ 6,553.0 6,553 1

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

33. 14.292 531.989 ↓ 6,553.0 6,553 1

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

34. 484.932 484.932 ↓ 6,553.0 6,553 1

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

35. 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)
36. 13.106 13.106 ↑ 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.002 rows=1 loops=6,553)

  • Index Cond: ((id)::integer = (r_4.delivery_id)::integer)
37. 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)
38. 65.490 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)

39.          

Initplan (for Aggregate)

40. 0.037 0.040 ↑ 1.0 1 1

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

41. 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)

42. 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)

43. 0.004 0.009 ↑ 1.0 16 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
44. 0.005 0.005 ↑ 1.0 16 1

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

45.          

SubPlan (for Hash Left Join)

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

  • Filter: (is_active IS NOT TRUE)
  • Rows Removed by Filter: 3
48. 1.056 1.056 ↓ 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.006..0.006 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
49. 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))
50. 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
51. 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)
52. 32.765 32.765 ↑ 1.0 1 6,553

Index Scan using direct_routes_info_idx1 on direct_routes_info dri (cost=0.43..8.45 rows=1 width=28) (actual time=0.005..0.005 rows=1 loops=6,553)

  • Index Cond: ((mcr.route_id)::integer = route_id)
53.          

SubPlan (for Nested Loop Left Join)

54. 58.977 209.696 ↑ 1.0 1 6,553

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

55. 58.977 150.719 ↓ 4.0 8 6,553

Nested Loop (cost=0.87..32.10 rows=2 width=16) (actual time=0.013..0.023 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
56. 26.212 26.212 ↑ 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.004..0.004 rows=1 loops=6,553)

  • Index Cond: ((id)::integer = (mcr.route_id)::integer)
57. 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)
58.          

CTE route_passes

59. 0.003 24.491 ↓ 19.0 19 1

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

60. 0.036 24.488 ↓ 19.0 19 1

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

  • Sort Key: mcr_1.route_id
  • Sort Method: quicksort Memory: 26kB
61. 0.078 24.452 ↓ 19.0 19 1

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

62. 2.809 2.809 ↓ 19.0 19 1

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

  • Filter: with_psses
  • Rows Removed by Filter: 6,534
63. 21.318 21.565 ↑ 1.0 1 19

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

64.          

SubPlan (for Function Scan)

65. 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)

66. 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
67.          

CTE cr_rpa

68. 3.395 4,473.927 ↓ 6,553.0 6,553 1

Unique (cost=30.76..30.77 rows=1 width=354) (actual time=4,463.954..4,473.927 rows=6,553 loops=1)

69. 35.062 4,470.532 ↓ 16,440.7 49,322 1

Sort (cost=30.76..30.77 rows=3 width=354) (actual time=4,463.952..4,470.532 rows=49,322 loops=1)

  • Sort Key: cr2.route_id
  • Sort Method: quicksort Memory: 27,302kB
70. 57.890 4,435.470 ↓ 16,440.7 49,322 1

WindowAgg (cost=30.59..30.74 rows=3 width=354) (actual time=4,330.802..4,435.470 rows=49,322 loops=1)

71. 38.213 4,377.580 ↓ 16,440.7 49,322 1

WindowAgg (cost=30.59..30.67 rows=3 width=354) (actual time=4,330.771..4,377.580 rows=49,322 loops=1)

72. 58.026 4,339.367 ↓ 16,440.7 49,322 1

Sort (cost=30.59..30.59 rows=3 width=354) (actual time=4,330.757..4,339.367 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: 28,887kB
73. 53.178 4,281.341 ↓ 16,440.7 49,322 1

WindowAgg (cost=30.48..30.56 rows=3 width=354) (actual time=4,218.785..4,281.341 rows=49,322 loops=1)

74. 92.866 4,228.163 ↓ 16,440.7 49,322 1

Sort (cost=30.48..30.49 rows=3 width=354) (actual time=4,218.752..4,228.163 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: 27,563kB
75. 26.242 4,135.297 ↓ 16,440.7 49,322 1

Nested Loop Left Join (cost=0.87..30.46 rows=3 width=354) (actual time=205.779..4,135.297 rows=49,322 loops=1)

76. 3,912.465 3,912.465 ↓ 6,553.0 6,553 1

CTE Scan on controled_routes cr2 (cost=0.00..0.02 rows=1 width=296) (actual time=205.756..3,912.465 rows=6,553 loops=1)

77. 15.454 196.590 ↓ 4.0 8 6,553

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

78. 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)
79. 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.002..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
80. 9.926 5,633.360 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,810.84..20,338.14 rows=1 width=1,598) (actual time=4,587.663..5,633.360 rows=6,553 loops=1)

  • Join Filter: (r.scheme_id = rs.id)
  • Rows Removed by Join Filter: 19,609
81. 5.597 5,616.881 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,810.84..20,337.07 rows=1 width=1,589) (actual time=4,587.647..5,616.881 rows=6,553 loops=1)

82. 2.141 5,598.178 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,810.42..20,336.62 rows=1 width=1,526) (actual time=4,587.629..5,598.178 rows=6,553 loops=1)

  • Join Filter: cr_rpa.is_transit
  • Rows Removed by Join Filter: 9
83. 25.390 5,576.378 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,810.00..20,336.17 rows=1 width=1,455) (actual time=4,587.601..5,576.378 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
84. 13.736 5,537.882 ↓ 6,553.0 6,553 1

Hash Left Join (cost=6,810.00..20,334.93 rows=1 width=1,458) (actual time=4,587.577..5,537.882 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))
85. 3.293 5,524.131 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,808.61..20,333.49 rows=1 width=1,461) (actual time=4,587.525..5,524.131 rows=6,553 loops=1)

  • Join Filter: cr_rpa.is_transit
86. 4.714 5,501.179 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,808.18..20,333.04 rows=1 width=1,444) (actual time=4,587.501..5,501.179 rows=6,553 loops=1)

87. 4.684 5,483.359 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,807.75..20,332.47 rows=1 width=1,442) (actual time=4,587.485..5,483.359 rows=6,553 loops=1)

88. 5.015 5,452.463 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,807.31..20,331.90 rows=1 width=1,440) (actual time=4,587.461..5,452.463 rows=6,553 loops=1)

89. 7.030 5,447.448 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,807.18..20,331.74 rows=1 width=1,403) (actual time=4,587.451..5,447.448 rows=6,553 loops=1)

90. 5.804 5,414.206 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,806.75..20,331.24 rows=1 width=1,398) (actual time=4,587.428..5,414.206 rows=6,553 loops=1)

91. 5.131 5,349.425 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,805.93..20,330.24 rows=1 width=1,330) (actual time=4,587.352..5,349.425 rows=6,553 loops=1)

92. 5.118 5,344.294 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,805.65..20,328.61 rows=1 width=1,284) (actual time=4,587.338..5,344.294 rows=6,553 loops=1)

93. 5.195 5,339.176 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,805.50..20,328.36 rows=1 width=1,284) (actual time=4,587.326..5,339.176 rows=6,553 loops=1)

94. 3.162 5,333.981 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,805.35..20,328.18 rows=1 width=1,284) (actual time=4,587.313..5,333.981 rows=6,553 loops=1)

95. 7.523 5,317.713 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,805.07..20,326.55 rows=1 width=1,238) (actual time=4,587.289..5,317.713 rows=6,553 loops=1)

96. 6.730 5,303.637 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,804.92..20,326.30 rows=1 width=1,238) (actual time=4,587.268..5,303.637 rows=6,553 loops=1)

97. 5.123 5,290.354 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,804.78..20,326.12 rows=1 width=1,238) (actual time=4,587.249..5,290.354 rows=6,553 loops=1)

98. 1.772 5,285.231 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,804.64..20,325.96 rows=1 width=1,216) (actual time=4,587.237..5,285.231 rows=6,553 loops=1)

99. 3.645 5,270.353 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,804.35..20,325.61 rows=1 width=1,148) (actual time=4,587.217..5,270.353 rows=6,553 loops=1)

100. 5.771 5,253.602 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,804.06..20,325.09 rows=1 width=1,132) (actual time=4,587.198..5,253.602 rows=6,553 loops=1)

101. 6.110 5,228.172 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,803.78..20,324.57 rows=1 width=1,124) (actual time=4,587.169..5,228.172 rows=6,553 loops=1)

102. 8.452 5,215.509 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,803.64..20,324.41 rows=1 width=1,126) (actual time=4,587.150..5,215.509 rows=6,553 loops=1)

103. 7.728 5,200.504 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,803.50..20,324.25 rows=1 width=1,128) (actual time=4,587.130..5,200.504 rows=6,553 loops=1)

104. 3.408 5,186.223 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,803.23..20,323.94 rows=1 width=1,124) (actual time=4,587.114..5,186.223 rows=6,553 loops=1)

105. 4.782 5,150.050 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,802.80..20,323.40 rows=1 width=1,101) (actual time=4,587.073..5,150.050 rows=6,553 loops=1)

106. 1.722 5,138.715 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,802.67..20,323.24 rows=1 width=1,077) (actual time=4,587.053..5,138.715 rows=6,553 loops=1)

107. 6.624 5,123.887 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,802.38..20,322.92 rows=1 width=1,073) (actual time=4,587.036..5,123.887 rows=6,553 loops=1)

108. 5.709 5,097.604 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,802.10..20,322.38 rows=1 width=1,072) (actual time=4,587.012..5,097.604 rows=6,553 loops=1)

109. 3.349 5,072.236 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,801.81..20,322.05 rows=1 width=1,072) (actual time=4,586.984..5,072.236 rows=6,553 loops=1)

110. 5.823 5,055.781 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,801.53..20,321.74 rows=1 width=1,062) (actual time=4,586.965..5,055.781 rows=6,553 loops=1)

111. 3.297 5,043.405 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,801.40..20,321.58 rows=1 width=1,055) (actual time=4,586.949..5,043.405 rows=6,553 loops=1)

112. 5.487 5,033.555 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,801.26..20,321.41 rows=1 width=1,040) (actual time=4,586.933..5,033.555 rows=6,553 loops=1)

113. 9.539 5,021.515 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,801.12..20,321.24 rows=1 width=1,020) (actual time=4,586.913..5,021.515 rows=6,553 loops=1)

114. 3.562 4,992.317 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=6,800.70..20,320.53 rows=1 width=1,004) (actual time=4,586.885..4,992.317 rows=6,553 loops=1)

115. 23.925 4,962.543 ↓ 6,553.0 6,553 1

Hash Join (cost=6,800.41..20,320.22 rows=1 width=1,000) (actual time=4,586.859..4,962.543 rows=6,553 loops=1)

  • Hash Cond: ((c.id)::integer = (r.car_id)::integer)
116. 50.609 410.740 ↑ 1.0 88,599 1

Hash Left Join (cost=6,791.59..19,979.14 rows=88,599 width=354) (actual time=58.930..410.740 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)
117. 14.243 360.114 ↑ 1.0 88,599 1

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

118. 0.061 0.068 ↑ 1.0 1 1

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

119. 0.007 0.007 ↑ 1.0 36 1

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

120. 21.928 345.803 ↑ 1.0 88,599 1

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

  • Hash Cond: ((c.trailer_id)::integer = (ts.trailer_id)::integer)
121. 46.136 319.405 ↑ 1.0 88,599 1

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

  • Hash Cond: ((c.id)::integer = (cs.car_id)::integer)
122. 18.334 247.867 ↑ 1.0 88,599 1

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

  • Hash Cond: ((c.gps_device_id)::integer = (rusc.gps_device_id)::integer)
123. 23.177 227.083 ↑ 1.0 88,599 1

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

  • Hash Cond: ((c.warm_type_id)::integer = (wt_c.id)::integer)
124. 15.991 203.895 ↑ 1.0 88,599 1

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

  • Hash Cond: (c.temperature_sensor_model_id = tsm_c.id)
125. 14.143 187.891 ↑ 1.0 88,599 1

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

  • Hash Cond: ((c.autocades_id)::integer = (a.id)::integer)
126. 24.602 173.625 ↑ 1.0 88,599 1

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

  • Hash Cond: ((c.company_owner_id)::integer = (c_cto.id)::integer)
127. 18.225 148.527 ↑ 1.0 88,599 1

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

  • Hash Cond: ((c.car_trailer_brand_id)::integer = ctb_c.id)
128. 20.696 130.238 ↑ 1.0 88,599 1

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

  • Hash Cond: ((c.id)::integer = (cg.car_id)::integer)
129. 23.173 105.304 ↑ 1.0 88,599 1

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

  • Hash Cond: ((c.type_delivery)::integer = dtt.id)
130. 45.492 82.120 ↑ 1.0 88,599 1

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

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

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

132. 1.639 20.669 ↑ 1.0 11,244 1

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

  • Buckets: 16,384 Batches: 1 Memory Usage: 648kB
133. 1.479 19.030 ↑ 1.0 11,244 1

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

  • Hash Cond: ((ph.simcard_abroad_id)::integer = (sim_abroad.id)::integer)
134. 4.423 9.363 ↑ 1.0 11,244 1

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

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

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

136. 1.361 3.030 ↑ 1.0 11,244 1

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

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

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

138. 4.331 8.188 ↑ 1.0 31,056 1

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

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

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

140. 0.007 0.011 ↑ 1.0 7 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
141. 0.004 0.004 ↑ 1.0 7 1

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

142. 1.617 4.238 ↑ 1.0 12,951 1

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

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

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

144. 0.035 0.064 ↑ 1.0 168 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 19kB
145. 0.029 0.029 ↑ 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.029 rows=168 loops=1)

146. 0.254 0.496 ↑ 1.0 1,226 1

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

  • Buckets: 2,048 Batches: 1 Memory Usage: 113kB
147. 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)

148. 0.055 0.123 ↑ 1.0 396 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 26kB
149. 0.068 0.068 ↑ 1.0 396 1

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

150. 0.009 0.013 ↑ 1.0 23 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
151. 0.004 0.004 ↑ 1.0 23 1

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

152. 0.005 0.011 ↑ 1.0 6 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
153. 0.006 0.006 ↑ 1.0 6 1

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

154. 1.019 2.450 ↑ 1.0 8,085 1

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

  • Buckets: 8,192 Batches: 1 Memory Usage: 423kB
155. 1.431 1.431 ↑ 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.004..1.431 rows=8,085 loops=1)

156. 13.417 25.402 ↑ 1.0 88,599 1

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

  • Buckets: 131,072 Batches: 1 Memory Usage: 5,089kB
157. 11.985 11.985 ↑ 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.007..11.985 rows=88,599 loops=1)

158. 2.359 4.470 ↑ 1.0 19,960 1

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

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

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

160. 0.013 0.017 ↑ 1.0 36 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 11kB
161. 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.002..0.004 rows=36 loops=1)

162. 7.916 4,527.878 ↓ 6,553.0 6,553 1

Hash (cost=8.81..8.81 rows=1 width=654) (actual time=4,527.878..4,527.878 rows=6,553 loops=1)

  • Buckets: 8,192 (originally 1024) Batches: 1 (originally 1) Memory Usage: 3,440kB
163. 5.545 4,519.962 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=0.70..8.81 rows=1 width=654) (actual time=4,464.068..4,519.962 rows=6,553 loops=1)

  • Join Filter: (r.opened IS TRUE)
164. 5.415 4,514.417 ↓ 6,553.0 6,553 1

Nested Loop Left Join (cost=0.57..8.65 rows=1 width=609) (actual time=4,464.043..4,514.417 rows=6,553 loops=1)

165. 11.473 4,509.002 ↓ 6,553.0 6,553 1

Nested Loop (cost=0.43..8.48 rows=1 width=566) (actual time=4,464.016..4,509.002 rows=6,553 loops=1)

166. 4,477.870 4,477.870 ↓ 6,553.0 6,553 1

CTE Scan on cr_rpa (cost=0.00..0.02 rows=1 width=227) (actual time=4,463.961..4,477.870 rows=6,553 loops=1)

167. 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)
168. 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)
169. 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
170. 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)
171. 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)
172. 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)
173. 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)
174. 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)
175. 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)
176. 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
177. 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)
178. 13.106 13.106 ↑ 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.002 rows=1 loops=6,553)

  • Index Cond: ((id)::integer = (t.gps_device_id)::integer)
179. 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)
180. 32.765 32.765 ↑ 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.005 rows=1 loops=6,553)

  • Index Cond: ((route_id)::integer = (r.id)::integer)
181. 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)
182. 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)
183. 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)
184. 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.003..0.003 rows=1 loops=6,553)

  • Index Cond: (gps_device_id = (gdc.id)::integer)
185. 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)
186. 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)
187. 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)
188. 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)
189. 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)
190. 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)
191. 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)
192. 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)
193. 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)
194. 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)

195. 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)

196. 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)

197. 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)
198. 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
199. 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)
200. 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)
201. 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)
202. 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)
203. 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.004..0.004 rows=1 loops=6,553)

  • Index Cond: (((route_id)::integer = (r.id)::integer) AND (tr_type = 0))
204. 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))
205. 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.003..0.003 rows=0 loops=6,553)

  • Index Cond: ((route_id)::integer = (r.id)::integer)
206. 0.011 0.015 ↑ 1.0 13 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
207. 0.004 0.004 ↑ 1.0 13 1

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

208. 13.106 13.106 ↑ 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.002 rows=8 loops=6,553)

209. 19.659 19.659 ↓ 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.003..0.003 rows=0 loops=6,553)

  • Index Cond: (route_id = (r.id)::integer)
210. 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)
211. 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)

212. 39.318 39.318 ↓ 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.006 rows=19 loops=6,553)

213.          

SubPlan (for Nested Loop Left Join)

214. 26.212 26.212 ↓ 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.004..0.004 rows=0 loops=6,553)

  • Index Cond: ((state = 0) AND (route_id = (r.id)::integer))
  • Heap Fetches: 0
215. 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
216. 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)
217. 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 : 51.569 ms
Execution time : 7,743.072 ms