explain.depesz.com

PostgreSQL's explain analyze made readable

Result: RNfF

Settings
# exclusive inclusive rows x rows loops node
1. 2,382.991 7,851.511 ↓ 3,272.0 6,544 1

Hash Left Join (cost=49,900.79..63,491.15 rows=2 width=1,740) (actual time=4,375.391..7,851.511 rows=6,544 loops=1)

  • Hash Cond: ((cp_rpa.route_id)::integer = (p.route_id)::integer)
2.          

CTE meta_control_routes

3. 5.744 404.186 ↓ 3,272.0 6,544 1

Unique (cost=42,885.96..42,886.03 rows=2 width=174) (actual time=395.037..404.186 rows=6,544 loops=1)

4. 8.764 398.442 ↓ 3,272.0 6,544 1

Sort (cost=42,885.96..42,885.96 rows=2 width=174) (actual time=395.037..398.442 rows=6,544 loops=1)

  • Sort Key: r_2.car_id, r_2.id, (((r_2.id)::integer = (c_1.last_route_id)::integer)), r_2.open_date, ((r_2.routes_type_transits IS NOT NULL)), ((COALESCE(((SubPlan 1))::timestamp with time zone, now()))::datetime), d.distribution_center_name, d.distribution_center_id, d.datetime, (string_agg(DISTINCT concat_ws(' '::text, dr.sname, dr.name, dr.pname), ', '::text)), (string_agg(DISTINCT (COALESCE((dr.phones)::character varying, ''::character varying))::text, ', '::text)), (string_agg(DISTINCT (COALESCE((dr.address)::character varying, ''::character varying))::text, ', '::text)), (string_agg(((rd.driver_id)::character varying)::text, ','::text)), ((cto.is_own AND (alternatives: SubPlan 2 or hashed SubPlan 3)))
  • Sort Method: quicksort Memory: 2,280kB
5. 66.318 389.678 ↓ 3,272.0 6,544 1

GroupAggregate (cost=41,916.17..42,885.95 rows=2 width=174) (actual time=184.460..389.678 rows=6,544 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
6. 9.447 186.836 ↓ 3,566.0 7,132 1

Sort (cost=41,916.17..41,916.18 rows=2 width=174) (actual time=184.380..186.836 rows=7,132 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,311kB
7. 0.583 177.389 ↓ 3,566.0 7,132 1

Nested Loop (cost=77.16..41,916.16 rows=2 width=174) (actual time=0.641..177.389 rows=7,132 loops=1)

8. 30.940 149.790 ↓ 6,754.0 6,754 1

Nested Loop (cost=76.73..41,913.65 rows=1 width=170) (actual time=0.630..149.790 rows=6,754 loops=1)

9. 1.407 92.626 ↓ 6,556.0 6,556 1

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

10. 7.095 78.105 ↓ 6,557.0 6,557 1

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

11. 13.314 41.630 ↓ 1.1 7,345 1

Hash Join (cost=75.58..4,200.01 rows=6,497 width=9) (actual time=0.578..41.630 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
12. 27.755 27.755 ↑ 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.004..27.755 rows=60,468 loops=1)

  • Filter: (NOT archive)
  • Rows Removed by Filter: 28,131
13. 0.160 0.561 ↑ 1.0 1,226 1

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

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

15. 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.004..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))
16. 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
17. 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.004..0.004 rows=1 loops=6,556)

  • Index Cond: ((id)::integer = ANY ((regexp_split_to_array((r_2.current_drivers_id)::text, ','::text))::integer[]))
18. 27.016 27.016 ↑ 2.0 1 6,754

Index Only Scan using routes_drivers_idx on routes_drivers rd (cost=0.43..2.49 rows=2 width=8) (actual time=0.003..0.004 rows=1 loops=6,754)

  • Index Cond: (route_id = (r_2.id)::integer)
  • Heap Fetches: 7,132
19.          

SubPlan (for GroupAggregate)

20. 0.000 39.264 ↓ 0.0 0 6,544

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

21. 13.088 39.264 ↓ 0.0 0 6,544

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

  • Sort Key: r2.open_date, r2.open_date_disp
  • Sort Method: quicksort Memory: 25kB
22. 26.176 26.176 ↓ 0.0 0 6,544

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

  • 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))
23. 24.795 97.260 ↓ 0.0 0 4,863

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

  • Hash Cond: (mp.market_id = (rpm.object_id)::integer)
24. 18.972 18.972 ↑ 1.0 89 3,162

Seq Scan on markets_passes mp (cost=0.00..1.89 rows=89 width=4) (actual time=0.001..0.006 rows=89 loops=3,162)

25. 4.863 53.493 ↑ 1.2 4 4,863

Hash (cost=25.54..25.54 rows=5 width=4) (actual time=0.011..0.011 rows=4 loops=4,863)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
26. 48.630 48.630 ↑ 1.2 4 4,863

Index Scan using routes_points_manual_idx1 on routes_points_manual rpm (cost=0.43..25.54 rows=5 width=4) (actual time=0.005..0.010 rows=4 loops=4,863)

  • Index Cond: ((route_id)::integer = (r_2.id)::integer)
  • Filter: ((object_var)::text = 'market'::text)
  • Rows Removed by Filter: 4
27. 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)
28. 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)
29. 0.000 0.000 ↓ 0.0 0

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

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

31.          

CTE controled_routes

32. 2,857.822 3,673.433 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=14.75..130.93 rows=2 width=198) (actual time=400.390..3,673.433 rows=6,544 loops=1)

33. 72.385 593.115 ↓ 3,272.0 6,544 1

Hash Left Join (cost=14.31..47.76 rows=2 width=174) (actual time=395.173..593.115 rows=6,544 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 ((($17) -> 'CHELNOK'::text))::integer WHEN ((r_4.routes_types_services IS NOT NULL) AND (COALESCE(r_4.type_ext, '-1'::integer) = 0)) THEN ((($17) -> '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 ((($17) -> '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 ((($17) -> '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 ((($17) -> 'COMMERCE'::text))::integer ELSE ((($17) -> '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 ((($17) -> '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 ((($17) -> '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 ((($17) -> 'COMMERCE'::text))::integer ELSE ((($17) -> '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 ((($17) -> '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 ((($17) -> '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 ((($17) -> 'COMMERCE'::text))::integer ELSE ((($17) -> '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 ((($17) -> 'WAREHOUSES'::text))::integer WHEN (r_4.opened_backwards IS TRUE) THEN CASE WHEN (alternatives: SubPlan 8 or hashed SubPlan 9) THEN ((($17) -> 'BACKWARDS_TD'::text))::integer ELSE ((($17) -> 'BACKWARDS_PD'::text))::integer END WHEN (alternatives: SubPlan 10 or hashed SubPlan 11) THEN ((($17) -> 'PD'::text))::integer WHEN (r_4.routes_types_services IS NOT NULL) THEN CASE COALESCE(r_4.type_ext, '-1'::integer) WHEN 0 THEN ((($17) -> 'EMPTY_PD'::text))::integer WHEN 1 THEN ((($17) -> 'TRIP'::text))::integer ELSE ((($17) -> 'SERVICE'::text))::integer END ELSE ((($17) -> 'PD'::text))::integer END END = rt.id)
34. 1.719 479.866 ↓ 3,272.0 6,544 1

Nested Loop (cost=3.36..20.63 rows=2 width=309) (actual time=395.116..479.866 rows=6,544 loops=1)

35. 0.019 0.052 ↑ 1.0 1 1

Aggregate (cost=2.35..2.37 rows=1 width=34) (actual time=0.052..0.052 rows=1 loops=1)

36.          

Initplan (for Aggregate)

37. 0.025 0.029 ↑ 1.0 1 1

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

38. 0.004 0.004 ↑ 1.0 16 1

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

39. 0.004 0.004 ↑ 1.0 4 1

Seq Scan on deliveries_cars_tasks_types dcttt (cost=0.00..1.04 rows=4 width=34) (actual time=0.004..0.004 rows=4 loops=1)

40. 3.378 478.095 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=1.01..18.23 rows=2 width=213) (actual time=395.062..478.095 rows=6,544 loops=1)

41. 6.157 468.173 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=0.72..17.59 rows=2 width=209) (actual time=395.060..468.173 rows=6,544 loops=1)

42. 13.751 448.928 ↓ 3,272.0 6,544 1

Nested Loop (cost=0.43..16.96 rows=2 width=195) (actual time=395.053..448.928 rows=6,544 loops=1)

43. 409.001 409.001 ↓ 3,272.0 6,544 1

CTE Scan on meta_control_routes mcr (cost=0.00..0.04 rows=2 width=155) (actual time=395.039..409.001 rows=6,544 loops=1)

44. 26.176 26.176 ↑ 1.0 1 6,544

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

  • Index Cond: ((id)::integer = (mcr.route_id)::integer)
45. 13.088 13.088 ↑ 1.0 1 6,544

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

  • Index Cond: ((id)::integer = (r_4.delivery_id)::integer)
46. 6.544 6.544 ↓ 0.0 0 6,544

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

  • Index Cond: ((id)::integer = (r_4.deliveries_cars_tasks_id)::integer)
47. 0.003 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
48. 0.006 0.006 ↑ 1.0 16 1

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

49.          

SubPlan (for Hash Left Join)

50. 0.013 0.013 ↑ 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.012..0.013 rows=3 loops=1)

  • Filter: (is_active IS NOT TRUE)
  • Rows Removed by Filter: 3
51. 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
52. 0.880 0.880 ↓ 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.005..0.005 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
53. 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))
54. 39.960 39.960 ↑ 5.0 1 7,992

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.005..0.005 rows=1 loops=7,992)

  • Index Cond: ((route_id)::integer = (r_4.id)::integer)
  • Filter: ((object_var)::text = 'market'::text)
  • Rows Removed by Filter: 1
55. 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)
56. 26.176 26.176 ↑ 1.0 1 6,544

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

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

SubPlan (for Nested Loop Left Join)

58. 58.896 196.320 ↑ 1.0 1 6,544

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

59. 58.896 137.424 ↓ 4.0 8 6,544

Nested Loop (cost=0.87..32.10 rows=2 width=16) (actual time=0.012..0.021 rows=8 loops=6,544)

  • 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
60. 26.176 26.176 ↑ 1.0 1 6,544

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

  • Index Cond: ((id)::integer = (mcr.route_id)::integer)
61. 52.352 52.352 ↑ 1.2 8 6,544

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

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

CTE passes2

63. 0.002 24.859 ↓ 19.0 19 1

Unique (cost=0.33..0.34 rows=1 width=164) (actual time=24.853..24.859 rows=19 loops=1)

64. 0.038 24.857 ↓ 19.0 19 1

Sort (cost=0.33..0.33 rows=1 width=164) (actual time=24.852..24.857 rows=19 loops=1)

  • Sort Key: mcr_1.route_id
  • Sort Method: quicksort Memory: 26kB
65. 0.074 24.819 ↓ 19.0 19 1

Nested Loop (cost=0.25..0.32 rows=1 width=164) (actual time=3.456..24.819 rows=19 loops=1)

66. 1.907 1.907 ↓ 19.0 19 1

CTE Scan on meta_control_routes mcr_1 (cost=0.00..0.04 rows=1 width=40) (actual time=0.012..1.907 rows=19 loops=1)

  • Filter: with_psses
  • Rows Removed by Filter: 6,525
67. 22.838 22.838 ↑ 1.0 1 19

Function Scan on necessary_passes np (cost=0.25..0.26 rows=1 width=160) (actual time=1.202..1.202 rows=1 loops=19)

68.          

CTE cr_rpa

69. 3.924 4,233.273 ↓ 3,272.0 6,544 1

Unique (cost=61.47..61.50 rows=2 width=355) (actual time=4,222.434..4,233.273 rows=6,544 loops=1)

70. 36.512 4,229.349 ↓ 9,857.6 49,288 1

Sort (cost=61.47..61.48 rows=5 width=355) (actual time=4,222.433..4,229.349 rows=49,288 loops=1)

  • Sort Key: cr2.route_id
  • Sort Method: quicksort Memory: 27,816kB
71. 61.822 4,192.837 ↓ 9,857.6 49,288 1

WindowAgg (cost=61.16..61.41 rows=5 width=355) (actual time=4,083.398..4,192.837 rows=49,288 loops=1)

72. 40.579 4,131.015 ↓ 9,857.6 49,288 1

WindowAgg (cost=61.16..61.30 rows=5 width=355) (actual time=4,083.376..4,131.015 rows=49,288 loops=1)

73. 53.456 4,090.436 ↓ 9,857.6 49,288 1

Sort (cost=61.16..61.18 rows=5 width=355) (actual time=4,083.367..4,090.436 rows=49,288 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,857kB
74. 54.896 4,036.980 ↓ 9,857.6 49,288 1

WindowAgg (cost=60.97..61.11 rows=5 width=355) (actual time=3,974.346..4,036.980 rows=49,288 loops=1)

75. 79.346 3,982.084 ↓ 9,857.6 49,288 1

Sort (cost=60.97..60.98 rows=5 width=355) (actual time=3,974.333..3,982.084 rows=49,288 loops=1)

  • Sort Key: rpa_3.route_id, rpa_3.type_id DESC, rpa_3.order_num DESC
  • Sort Method: quicksort Memory: 27,540kB
76. 25.725 3,902.738 ↓ 9,857.6 49,288 1

Nested Loop Left Join (cost=0.87..60.91 rows=5 width=355) (actual time=400.409..3,902.738 rows=49,288 loops=1)

77. 3,687.237 3,687.237 ↓ 3,272.0 6,544 1

CTE Scan on controled_routes cr2 (cost=0.00..0.04 rows=2 width=297) (actual time=400.392..3,687.237 rows=6,544 loops=1)

78. 58.210 189.776 ↓ 4.0 8 6,544

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

79. 32.720 32.720 ↑ 1.2 8 6,544

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.002..0.005 rows=8 loops=6,544)

  • Index Cond: ((route_id)::integer = (cr2.route_id)::integer)
80. 98.846 98.846 ↑ 1.0 1 49,423

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

  • 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
81. 4.593 5,443.637 ↓ 3,272.0 6,544 1

Hash Left Join (cost=6,821.97..20,361.25 rows=2 width=1,679) (actual time=4,349.118..5,443.637 rows=6,544 loops=1)

  • Hash Cond: (r.scheme_id = rs.id)
82. 6.861 5,439.035 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=6,820.90..20,360.17 rows=2 width=1,670) (actual time=4,349.089..5,439.035 rows=6,544 loops=1)

83. 8.799 5,419.086 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=6,820.48..20,359.27 rows=2 width=1,607) (actual time=4,349.074..5,419.086 rows=6,544 loops=1)

  • Join Filter: cp_rpa.is_transit
  • Rows Removed by Join Filter: 9
84. 6.503 5,397.199 ↓ 3,272.0 6,544 1

Hash Left Join (cost=6,820.06..20,358.37 rows=2 width=1,536) (actual time=4,349.051..5,397.199 rows=6,544 loops=1)

  • Hash Cond: ((COALESCE(r.opened, false) = frs.is_opened) AND (r.auto_open = frs.is_auto_open) AND ((haor.auto_open_route_id IS NOT NULL) = frs.has_future_route) AND (COALESCE(ref.status_future_route_opened, '-1'::integer) = frs.open_type))
85. 14.218 5,390.683 ↓ 3,272.0 6,544 1

Hash Left Join (cost=6,818.82..20,357.08 rows=2 width=1,539) (actual time=4,349.017..5,390.683 rows=6,544 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))
86. 5.453 5,376.447 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=6,817.43..20,355.60 rows=2 width=1,542) (actual time=4,348.964..5,376.447 rows=6,544 loops=1)

  • Join Filter: cp_rpa.is_transit
87. 5.843 5,351.362 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=6,817.00..20,354.68 rows=2 width=1,525) (actual time=4,348.946..5,351.362 rows=6,544 loops=1)

88. 8.063 5,332.431 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=6,816.57..20,353.55 rows=2 width=1,523) (actual time=4,348.934..5,332.431 rows=6,544 loops=1)

89. 5.888 5,298.192 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=6,816.13..20,352.41 rows=2 width=1,521) (actual time=4,348.916..5,298.192 rows=6,544 loops=1)

90. 3.938 5,292.304 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=6,816.00..20,352.10 rows=2 width=1,484) (actual time=4,348.907..5,292.304 rows=6,544 loops=1)

91. 5.250 5,255.646 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=6,815.57..20,351.10 rows=2 width=1,479) (actual time=4,348.888..5,255.646 rows=6,544 loops=1)

92. 5.651 5,184.956 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=6,814.75..20,349.09 rows=2 width=1,411) (actual time=4,348.832..5,184.956 rows=6,544 loops=1)

93. 5.709 5,179.305 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=6,814.47..20,345.84 rows=2 width=1,365) (actual time=4,348.819..5,179.305 rows=6,544 loops=1)

94. 5.459 5,173.596 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=6,814.32..20,345.33 rows=2 width=1,365) (actual time=4,348.808..5,173.596 rows=6,544 loops=1)

95. 5.341 5,168.137 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=6,814.17..20,344.98 rows=2 width=1,365) (actual time=4,348.785..5,168.137 rows=6,544 loops=1)

96. 7.844 5,149.708 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=6,813.89..20,341.72 rows=2 width=1,319) (actual time=4,348.765..5,149.708 rows=6,544 loops=1)

97. 8.049 5,135.320 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=6,813.74..20,341.21 rows=2 width=1,319) (actual time=4,348.750..5,135.320 rows=6,544 loops=1)

98. 5.450 5,120.727 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=6,813.60..20,340.86 rows=2 width=1,319) (actual time=4,348.735..5,120.727 rows=6,544 loops=1)

99. 2.939 5,115.277 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=6,813.46..20,340.52 rows=2 width=1,297) (actual time=4,348.724..5,115.277 rows=6,544 loops=1)

100. 5.866 5,099.250 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=6,813.17..20,339.83 rows=2 width=1,229) (actual time=4,348.706..5,099.250 rows=6,544 loops=1)

101. 8.572 5,080.296 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=6,812.88..20,338.80 rows=2 width=1,213) (actual time=4,348.688..5,080.296 rows=6,544 loops=1)

102. 7.796 5,052.092 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=6,812.60..20,337.76 rows=2 width=1,205) (actual time=4,348.667..5,052.092 rows=6,544 loops=1)

103. 3.398 5,037.752 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=6,812.46..20,337.44 rows=2 width=1,207) (actual time=4,348.649..5,037.752 rows=6,544 loops=1)

104. 2.698 5,021.266 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=6,812.32..20,337.11 rows=2 width=1,209) (actual time=4,348.630..5,021.266 rows=6,544 loops=1)

105. 4.919 5,005.480 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=6,812.05..20,336.50 rows=2 width=1,205) (actual time=4,348.614..5,005.480 rows=6,544 loops=1)

106. 5.788 4,967.841 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=6,811.62..20,335.41 rows=2 width=1,182) (actual time=4,348.590..4,967.841 rows=6,544 loops=1)

107. 3.582 4,955.509 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=6,811.49..20,335.09 rows=2 width=1,158) (actual time=4,348.574..4,955.509 rows=6,544 loops=1)

108. 8.974 4,938.839 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=6,811.20..20,334.46 rows=2 width=1,154) (actual time=4,348.558..4,938.839 rows=6,544 loops=1)

109. 8.659 4,910.233 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=6,810.92..20,333.37 rows=2 width=1,153) (actual time=4,348.537..4,910.233 rows=6,544 loops=1)

110. 4.808 4,881.942 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=6,810.63..20,332.72 rows=2 width=1,153) (actual time=4,348.514..4,881.942 rows=6,544 loops=1)

111. 6.467 4,864.046 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=6,810.35..20,332.09 rows=2 width=1,143) (actual time=4,348.483..4,864.046 rows=6,544 loops=1)

112. 3.927 4,851.035 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=6,810.22..20,331.77 rows=2 width=1,136) (actual time=4,348.470..4,851.035 rows=6,544 loops=1)

113. 6.387 4,840.564 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=6,810.08..20,331.44 rows=2 width=1,121) (actual time=4,348.459..4,840.564 rows=6,544 loops=1)

114. 4.473 4,827.633 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=6,809.94..20,331.09 rows=2 width=1,101) (actual time=4,348.441..4,827.633 rows=6,544 loops=1)

115. 7.519 4,796.984 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=6,809.52..20,329.67 rows=2 width=1,085) (actual time=4,348.418..4,796.984 rows=6,544 loops=1)

116. 27.452 4,763.289 ↓ 3,272.0 6,544 1

Hash Join (cost=6,809.23..20,329.05 rows=2 width=1,081) (actual time=4,348.394..4,763.289 rows=6,544 loops=1)

  • Hash Cond: ((c.id)::integer = (r.car_id)::integer)
117. 55.324 448.868 ↑ 1.0 88,599 1

Hash Left Join (cost=6,791.59..19,979.14 rows=88,599 width=370) (actual time=61.391..448.868 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)
118. 16.535 393.528 ↑ 1.0 88,599 1

Nested Loop (cost=6,789.78..19,042.61 rows=88,599 width=341) (actual time=61.352..393.528 rows=88,599 loops=1)

119. 0.055 0.064 ↑ 1.0 1 1

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

120. 0.009 0.009 ↑ 1.0 36 1

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

121. 24.831 376.929 ↑ 1.0 88,599 1

Hash Left Join (cost=6,788.24..18,155.05 rows=88,599 width=309) (actual time=61.258..376.929 rows=88,599 loops=1)

  • Hash Cond: ((c.trailer_id)::integer = (ts.trailer_id)::integer)
122. 51.232 347.505 ↑ 1.0 88,599 1

Hash Join (cost=6,225.14..17,060.10 rows=88,599 width=305) (actual time=56.536..347.505 rows=88,599 loops=1)

  • Hash Cond: ((c.id)::integer = (cs.car_id)::integer)
123. 19.936 269.555 ↑ 1.0 88,599 1

Hash Left Join (cost=3,610.66..13,227.39 rows=88,599 width=281) (actual time=29.275..269.555 rows=88,599 loops=1)

  • Hash Cond: ((c.gps_device_id)::integer = (rusc.gps_device_id)::integer)
124. 25.639 247.106 ↑ 1.0 88,599 1

Hash Left Join (cost=3,186.75..12,398.44 rows=88,599 width=271) (actual time=26.724..247.106 rows=88,599 loops=1)

  • Hash Cond: ((c.warm_type_id)::integer = (wt_c.id)::integer)
125. 17.083 221.457 ↑ 1.0 88,599 1

Hash Left Join (cost=3,185.61..11,179.07 rows=88,599 width=264) (actual time=26.699..221.457 rows=88,599 loops=1)

  • Hash Cond: (c.temperature_sensor_model_id = tsm_c.id)
126. 16.953 204.357 ↑ 1.0 88,599 1

Hash Left Join (cost=3,184.10..10,821.84 rows=88,599 width=249) (actual time=26.667..204.357 rows=88,599 loops=1)

  • Hash Cond: ((c.autocades_id)::integer = (a.id)::integer)
127. 26.530 187.283 ↑ 1.0 88,599 1

Hash Left Join (cost=3,168.19..10,406.14 rows=88,599 width=244) (actual time=26.539..187.283 rows=88,599 loops=1)

  • Hash Cond: ((c.company_owner_id)::integer = (c_cto.id)::integer)
128. 19.701 160.249 ↑ 1.0 88,599 1

Hash Left Join (cost=3,092.60..9,112.32 rows=88,599 width=206) (actual time=26.021..160.249 rows=88,599 loops=1)

  • Hash Cond: ((c.car_trailer_brand_id)::integer = ctb_c.id)
129. 25.192 140.490 ↑ 1.0 88,599 1

Hash Left Join (cost=3,084.82..8,439.02 rows=88,599 width=186) (actual time=25.953..140.490 rows=88,599 loops=1)

  • Hash Cond: ((c.id)::integer = (cg.car_id)::integer)
130. 24.219 110.816 ↑ 1.0 88,599 1

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

  • Hash Cond: ((c.type_delivery)::integer = dtt.id)
131. 48.305 86.584 ↑ 1.0 88,599 1

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

  • Hash Cond: ((c.phone_id)::integer = (ph.id)::integer)
132. 16.971 16.971 ↑ 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.971 rows=88,599 loops=1)

133. 1.698 21.308 ↑ 1.0 11,244 1

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

  • Buckets: 16,384 Batches: 1 Memory Usage: 648kB
134. 1.585 19.610 ↑ 1.0 11,244 1

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

  • Hash Cond: ((ph.simcard_abroad_id)::integer = (sim_abroad.id)::integer)
135. 4.662 9.872 ↑ 1.0 11,244 1

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

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

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

137. 1.546 3.170 ↑ 1.0 11,244 1

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

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

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

139. 4.347 8.153 ↑ 1.0 31,056 1

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

  • Buckets: 32,768 Batches: 1 Memory Usage: 1,833kB
140. 3.806 3.806 ↑ 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.806 rows=31,056 loops=1)

141. 0.009 0.013 ↑ 1.0 7 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
142. 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)

143. 2.058 4.482 ↑ 1.0 12,951 1

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

  • Buckets: 16,384 Batches: 1 Memory Usage: 855kB
144. 2.424 2.424 ↑ 1.0 12,951 1

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

145. 0.030 0.058 ↑ 1.0 168 1

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

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

147. 0.262 0.504 ↑ 1.0 1,226 1

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

  • Buckets: 2,048 Batches: 1 Memory Usage: 113kB
148. 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.004..0.242 rows=1,226 loops=1)

149. 0.057 0.121 ↑ 1.0 396 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 26kB
150. 0.064 0.064 ↑ 1.0 396 1

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

151. 0.008 0.017 ↑ 1.0 23 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
152. 0.009 0.009 ↑ 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.009 rows=23 loops=1)

153. 0.005 0.010 ↑ 1.0 6 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
154. 0.005 0.005 ↑ 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.005 rows=6 loops=1)

155. 1.160 2.513 ↑ 1.0 8,085 1

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

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

157. 14.215 26.718 ↑ 1.0 88,599 1

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

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

159. 2.495 4.593 ↑ 1.0 19,960 1

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

  • Buckets: 32,768 Batches: 1 Memory Usage: 1,036kB
160. 2.098 2.098 ↑ 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.098 rows=19,960 loops=1)

161. 0.011 0.016 ↑ 1.0 36 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 11kB
162. 0.005 0.005 ↑ 1.0 36 1

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

163. 8.565 4,286.969 ↓ 3,272.0 6,544 1

Hash (cost=17.62..17.62 rows=2 width=719) (actual time=4,286.969..4,286.969 rows=6,544 loops=1)

  • Buckets: 8,192 (originally 1024) Batches: 1 (originally 1) Memory Usage: 3,552kB
164. 6.118 4,278.404 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=0.70..17.62 rows=2 width=719) (actual time=4,222.527..4,278.404 rows=6,544 loops=1)

  • Join Filter: (r.opened IS TRUE)
165. 5.673 4,272.286 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=0.57..17.29 rows=2 width=674) (actual time=4,222.510..4,272.286 rows=6,544 loops=1)

166. 9.589 4,266.613 ↓ 3,272.0 6,544 1

Nested Loop (cost=0.43..16.96 rows=2 width=631) (actual time=4,222.473..4,266.613 rows=6,544 loops=1)

167. 4,237.392 4,237.392 ↓ 3,272.0 6,544 1

CTE Scan on cr_rpa cp_rpa (cost=0.00..0.04 rows=2 width=292) (actual time=4,222.439..4,237.392 rows=6,544 loops=1)

168. 19.632 19.632 ↑ 1.0 1 6,544

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

  • Index Cond: ((id)::integer = (cp_rpa.route_id)::integer)
169. 0.000 0.000 ↓ 0.0 0 6,544

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

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

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

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

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.004..0.004 rows=1 loops=6,544)

  • Index Cond: ((car_id)::integer = (c.id)::integer)
172. 26.176 26.176 ↑ 1.0 1 6,544

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

  • Index Cond: ((id)::integer = (c.trailer_id)::integer)
173. 6.544 6.544 ↑ 1.0 1 6,544

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

  • Index Cond: (id = (t.car_trailer_brand_id)::integer)
174. 6.544 6.544 ↑ 1.0 1 6,544

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

  • Index Cond: (t.temperature_sensor_model_id = id)
175. 6.544 6.544 ↑ 1.0 1 6,544

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

  • Index Cond: ((id)::integer = (t.warm_type_id)::integer)
176. 13.088 13.088 ↑ 1.0 1 6,544

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

  • Index Cond: ((gps_device_id)::integer = (t.gps_device_id)::integer)
177. 19.632 19.632 ↑ 1.0 1 6,544

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

  • Index Cond: (id = (c.gps_device_id)::integer)
  • Heap Fetches: 6,496
178. 19.632 19.632 ↑ 1.0 1 6,544

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

  • Index Cond: ((gps_device_id)::integer = (gdc.id)::integer)
179. 13.088 13.088 ↑ 1.0 1 6,544

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

  • Index Cond: ((id)::integer = (t.gps_device_id)::integer)
180. 6.544 6.544 ↑ 1.0 1 6,544

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

  • Index Cond: ((id)::integer = (gdt.gps_devices_model_id)::integer)
181. 32.720 32.720 ↑ 1.0 1 6,544

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

  • Index Cond: ((route_id)::integer = (r.id)::integer)
182. 13.088 13.088 ↓ 0.0 0 6,544

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.002..0.002 rows=0 loops=6,544)

  • Index Cond: ((route_id)::integer = (r.id)::integer)
  • Filter: (auto_open_type_id = 1)
183. 13.088 13.088 ↑ 1.0 1 6,544

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

  • Index Cond: ((id)::integer = (r.car_model_id)::integer)
184. 6.544 6.544 ↑ 1.0 1 6,544

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

  • Index Cond: ((id)::integer = (r.trailer_model_id)::integer)
185. 19.632 19.632 ↑ 1.0 1 6,544

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

  • Index Cond: (gps_device_id = (gdc.id)::integer)
186. 13.088 13.088 ↑ 1.0 1 6,544

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

  • Index Cond: (gps_device_id = (gdt.id)::integer)
187. 13.088 13.088 ↓ 0.0 0 6,544

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

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

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

  • Index Cond: (id = cch.comment_template)
189. 6.544 6.544 ↑ 1.0 1 6,544

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

  • Index Cond: ((id)::integer = (c.autocades_id)::integer)
190. 6.544 6.544 ↑ 1.0 1 6,544

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

  • Index Cond: ((id)::integer = (native_autocade.autocades_managers_id)::integer)
191. 13.088 13.088 ↑ 1.0 1 6,544

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

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

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

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

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

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

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

  • Index Cond: (user_oid = (am_prikom.user_oid)::oid)
195. 6.544 65.440 ↑ 1.0 1 6,544

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

196. 6.544 58.896 ↑ 1.0 1 6,544

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

197. 6.544 52.352 ↑ 1.0 1 6,544

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

198. 32.720 32.720 ↑ 1.0 1 6,544

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

  • Index Cond: ((route_id)::integer = (r.id)::integer)
199. 13.088 13.088 ↑ 1.0 1 6,544

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

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

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

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

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

  • Index Cond: ((id)::integer = (r_1.route_cause_id)::integer)
202. 32.720 32.720 ↑ 1.0 1 6,544

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.005 rows=1 loops=6,544)

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

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

  • Index Cond: ((id)::integer = (de_rb.cancel_cause_id)::integer)
204. 26.176 26.176 ↑ 1.0 1 6,544

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

  • Index Cond: (((route_id)::integer = (r.id)::integer) AND (tr_type = 0))
205. 13.088 13.088 ↓ 0.0 0 6,544

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

  • Index Cond: (((route_id)::integer = (r.id)::integer) AND (tr_type = 1))
206. 19.632 19.632 ↓ 0.0 0 6,544

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

  • Index Cond: ((route_id)::integer = (r.id)::integer)
207. 0.013 0.018 ↑ 1.0 13 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
208. 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)

209. 0.008 0.013 ↑ 1.0 8 1

Hash (cost=1.08..1.08 rows=8 width=7) (actual time=0.013..0.013 rows=8 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
210. 0.005 0.005 ↑ 1.0 8 1

Seq Scan on future_route_statuses frs (cost=0.00..1.08 rows=8 width=7) (actual time=0.004..0.005 rows=8 loops=1)

211. 13.088 13.088 ↓ 0.0 0 6,544

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

  • Index Cond: (route_id = (r.id)::integer)
212. 13.088 13.088 ↓ 0.0 0 6,544

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

  • Index Cond: (route_id = (r.id)::integer)
213. 0.005 0.009 ↑ 1.0 3 1

Hash (cost=1.03..1.03 rows=3 width=17) (actual time=0.009..0.009 rows=3 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
214. 0.004 0.004 ↑ 1.0 3 1

Seq Scan on routes_schemes rs (cost=0.00..1.03 rows=3 width=17) (actual time=0.004..0.004 rows=3 loops=1)

215. 0.006 24.872 ↓ 19.0 19 1

Hash (cost=0.02..0.02 rows=1 width=69) (actual time=24.872..24.872 rows=19 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
216. 24.866 24.866 ↓ 19.0 19 1

CTE Scan on passes2 p (cost=0.00..0.02 rows=1 width=69) (actual time=24.857..24.866 rows=19 loops=1)

217.          

SubPlan (for Hash Left Join)

218. 0.000 0.000 ↓ 0.0 0

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) (never executed)

  • Index Cond: ((state = 0) AND (route_id = (r.id)::integer))
  • Heap Fetches: 0
219. 0.011 0.011 ↓ 0.0 0 1

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) (actual time=0.011..0.011 rows=0 loops=1)

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

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

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

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

  • Index Cond: ((id)::integer = ref.open_receiver_autocade_id)
Planning time : 41.325 ms
Execution time : 7,857.870 ms