explain.depesz.com

PostgreSQL's explain analyze made readable

Result: UfPO

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 9,975.477 ↓ 0.0 0 1

Nested Loop Left Join (cost=49,847.43..63,400.26 rows=1 width=1,740) (actual time=9,975.477..9,975.477 rows=0 loops=1)

  • Join Filter: (r.scheme_id = rs.id)
2.          

CTE meta_control_routes

3. 6.953 458.327 ↓ 3,272.0 6,544 1

Unique (cost=42,885.95..42,886.03 rows=2 width=173) (actual time=447.258..458.327 rows=6,544 loops=1)

4. 9.765 451.374 ↓ 3,272.0 6,544 1

Sort (cost=42,885.95..42,885.96 rows=2 width=173) (actual time=447.257..451.374 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)), ((alternatives: SubPlan 2 or hashed SubPlan 3))
  • Sort Method: quicksort Memory: 2,262kB
5. 74.894 441.609 ↓ 3,272.0 6,544 1

GroupAggregate (cost=41,916.17..42,885.94 rows=2 width=173) (actual time=194.213..441.609 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
6. 9.781 196.571 ↓ 3,566.0 7,132 1

Sort (cost=41,916.17..41,916.18 rows=2 width=173) (actual time=194.100..196.571 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
  • Sort Method: quicksort Memory: 2,301kB
7. 2.964 186.790 ↓ 3,566.0 7,132 1

Nested Loop (cost=77.16..41,916.16 rows=2 width=173) (actual time=0.587..186.790 rows=7,132 loops=1)

8. 27.345 156.810 ↓ 6,754.0 6,754 1

Nested Loop (cost=76.73..41,913.65 rows=1 width=169) (actual time=0.577..156.810 rows=6,754 loops=1)

9. 2.681 96.685 ↓ 6,556.0 6,556 1

Nested Loop (cost=76.30..41,909.15 rows=1 width=59) (actual time=0.550..96.685 rows=6,556 loops=1)

10. 9.041 80.890 ↓ 6,557.0 6,557 1

Nested Loop (cost=76.02..41,908.83 rows=1 width=33) (actual time=0.543..80.890 rows=6,557 loops=1)

11. 14.043 42.469 ↓ 1.1 7,345 1

Hash Join (cost=75.58..4,200.01 rows=6,497 width=8) (actual time=0.529..42.469 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.912 27.912 ↑ 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.005..27.912 rows=60,468 loops=1)

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

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

  • Buckets: 2,048 Batches: 1 Memory Usage: 61kB
14. 0.380 0.380 ↑ 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.380 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. 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.004..0.005 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.004..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. 6.544 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. 32.720 32.720 ↓ 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.005..0.005 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. 38.401 130.880 ↓ 0.0 0 6,544

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

  • Hash Cond: (mp.market_id = (rpm.object_id)::integer)
24. 20.495 20.495 ↑ 1.0 89 4,099

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

25. 6.544 71.984 ↑ 1.7 3 6,544

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
26. 65.440 65.440 ↑ 1.7 3 6,544

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=3 loops=6,544)

  • Index Cond: ((route_id)::integer = (r_2.id)::integer)
  • Filter: ((object_var)::text = 'market'::text)
  • Rows Removed by Filter: 3
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. 3,021.098 9,868.667 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=15.00..131.23 rows=2 width=357) (actual time=454.777..9,868.667 rows=6,544 loops=1)

  • Join Filter: mcr.with_psses
  • Rows Removed by Join Filter: 6,524
33. 8.968 715.841 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=14.75..64.69 rows=2 width=234) (actual time=447.417..715.841 rows=6,544 loops=1)

34. 83.152 674.153 ↓ 3,272.0 6,544 1

Hash Left Join (cost=14.31..47.76 rows=2 width=210) (actual time=447.408..674.153 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)
35. 1.951 549.960 ↓ 3,272.0 6,544 1

Nested Loop (cost=3.36..20.63 rows=2 width=345) (actual time=447.351..549.960 rows=6,544 loops=1)

36. 0.020 0.064 ↑ 1.0 1 1

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

37.          

Initplan (for Aggregate)

38. 0.026 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)

39. 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.002..0.003 rows=16 loops=1)

40. 0.015 0.015 ↑ 1.0 4 1

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

41. 5.050 547.945 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=1.01..18.23 rows=2 width=249) (actual time=447.284..547.945 rows=6,544 loops=1)

42. 3.924 536.351 ↓ 3,272.0 6,544 1

Nested Loop Left Join (cost=0.72..17.59 rows=2 width=245) (actual time=447.282..536.351 rows=6,544 loops=1)

43. 16.033 512.795 ↓ 3,272.0 6,544 1

Nested Loop (cost=0.43..16.96 rows=2 width=231) (actual time=447.274..512.795 rows=6,544 loops=1)

44. 464.042 464.042 ↓ 3,272.0 6,544 1

CTE Scan on meta_control_routes mcr (cost=0.00..0.04 rows=2 width=191) (actual time=447.260..464.042 rows=6,544 loops=1)

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

  • Index Cond: ((id)::integer = (mcr.route_id)::integer)
46. 19.632 19.632 ↑ 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.003..0.003 rows=1 loops=6,544)

  • Index Cond: ((id)::integer = (r_4.delivery_id)::integer)
47. 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)
48. 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
49. 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.003..0.005 rows=16 loops=1)

50.          

SubPlan (for Hash Left Join)

51. 0.014 0.014 ↑ 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.014 rows=3 loops=1)

  • Filter: (is_active IS NOT TRUE)
  • Rows Removed by Filter: 3
52. 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
53. 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
54. 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))
55. 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
56. 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)
57. 32.720 32.720 ↑ 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.005..0.005 rows=1 loops=6,544)

  • Index Cond: ((mcr.route_id)::integer = route_id)
58. 5,941.952 5,941.952 ↑ 1.0 1 6,544

Function Scan on necessary_passes np (cost=0.25..0.26 rows=1 width=160) (actual time=0.908..0.908 rows=1 loops=6,544)

59.          

SubPlan (for Nested Loop Left Join)

60. 58.896 189.776 ↑ 1.0 1 6,544

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

61. 65.440 130.880 ↓ 4.0 8 6,544

Nested Loop (cost=0.87..32.10 rows=2 width=16) (actual time=0.011..0.020 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
62. 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)
63. 39.264 39.264 ↑ 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.003..0.006 rows=8 loops=6,544)

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

CTE cr_rpa

65. 0.001 9,975.388 ↓ 0.0 0 1

Unique (cost=19.28..19.33 rows=1 width=419) (actual time=9,975.388..9,975.388 rows=0 loops=1)

66. 0.002 9,975.387 ↓ 0.0 0 1

WindowAgg (cost=19.28..19.33 rows=1 width=419) (actual time=9,975.387..9,975.387 rows=0 loops=1)

67. 0.002 9,975.385 ↓ 0.0 0 1

WindowAgg (cost=19.28..19.31 rows=1 width=419) (actual time=9,975.385..9,975.385 rows=0 loops=1)

68. 0.007 9,975.383 ↓ 0.0 0 1

Sort (cost=19.28..19.28 rows=1 width=419) (actual time=9,975.383..9,975.383 rows=0 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: 25kB
69. 0.004 9,975.376 ↓ 0.0 0 1

WindowAgg (cost=19.24..19.27 rows=1 width=419) (actual time=9,975.376..9,975.376 rows=0 loops=1)

70. 0.004 9,975.372 ↓ 0.0 0 1

Sort (cost=19.24..19.24 rows=1 width=419) (actual time=9,975.372..9,975.372 rows=0 loops=1)

  • Sort Key: rpa_3.route_id, rpa_3.type_id DESC, rpa_3.order_num DESC
  • Sort Method: quicksort Memory: 25kB
71. 4.811 9,975.368 ↓ 0.0 0 1

Nested Loop (cost=0.87..19.23 rows=1 width=419) (actual time=9,975.368..9,975.368 rows=0 loops=1)

  • Join Filter: (cr2.points[array_length(cr2.points, 1)] = rpa_3.id)
72. 13.741 9,918.205 ↓ 3,272.0 6,544 1

Nested Loop (cost=0.43..16.96 rows=2 width=370) (actual time=454.788..9,918.205 rows=6,544 loops=1)

73. 9,884.832 9,884.832 ↓ 3,272.0 6,544 1

CTE Scan on controled_routes cr2 (cost=0.00..0.04 rows=2 width=361) (actual time=454.780..9,884.832 rows=6,544 loops=1)

74. 19.632 19.632 ↑ 1.0 1 6,544

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

  • Index Cond: ((id)::integer = (cr2.route_id)::integer)
75. 52.352 52.352 ↓ 0.0 0 6,544

Index Scan using routes_points_all_idx2 on routes_points_all rpa_3 (cost=0.43..1.12 rows=1 width=67) (actual time=0.008..0.008 rows=0 loops=6,544)

  • Index Cond: ((route_id)::integer = (r_5.id)::integer)
  • Filter: ((object_type = 'distirbution_center'::text) AND (COALESCE(r_5.opened, false) = COALESCE(open_route_point, false)) AND ((CASE WHEN (object_type = 'contractor'::text) THEN load_point_id ELSE object_id END)::integer = ANY ('{1}'::integer[])) AND CASE WHEN (r_5.routes_type_transits IS NOT NULL) THEN ((type_id)::integer = ANY ('{3,4}'::integer[])) WHEN (r_5.routes_type = 0) THEN ((type_id)::integer = ANY ('{1,4}'::integer[])) WHEN (r_5.routes_type = 1) THEN ((type_id)::integer = ANY ('{2,4}'::integer[])) ELSE false END)
  • Rows Removed by Filter: 8
76. 0.001 9,975.475 ↓ 0.0 0 1

Nested Loop Left Join (cost=6,810.84..20,337.07 rows=1 width=1,731) (actual time=9,975.475..9,975.475 rows=0 loops=1)

77. 0.002 9,975.474 ↓ 0.0 0 1

Nested Loop Left Join (cost=6,810.42..20,336.62 rows=1 width=1,668) (actual time=9,975.474..9,975.474 rows=0 loops=1)

  • Join Filter: cp_rpa.is_transit
78. 0.002 9,975.472 ↓ 0.0 0 1

Nested Loop Left Join (cost=6,810.00..20,336.17 rows=1 width=1,597) (actual time=9,975.472..9,975.472 rows=0 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)))
79. 0.002 9,975.470 ↓ 0.0 0 1

Hash Left Join (cost=6,810.00..20,334.93 rows=1 width=1,600) (actual time=9,975.470..9,975.470 rows=0 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))
80. 0.002 9,975.468 ↓ 0.0 0 1

Nested Loop Left Join (cost=6,808.61..20,333.49 rows=1 width=1,603) (actual time=9,975.468..9,975.468 rows=0 loops=1)

  • Join Filter: cp_rpa.is_transit
81. 0.001 9,975.466 ↓ 0.0 0 1

Nested Loop Left Join (cost=6,808.18..20,333.04 rows=1 width=1,586) (actual time=9,975.466..9,975.466 rows=0 loops=1)

82. 0.003 9,975.465 ↓ 0.0 0 1

Nested Loop Left Join (cost=6,807.75..20,332.47 rows=1 width=1,584) (actual time=9,975.465..9,975.465 rows=0 loops=1)

83. 0.002 9,975.462 ↓ 0.0 0 1

Nested Loop Left Join (cost=6,807.31..20,331.90 rows=1 width=1,582) (actual time=9,975.462..9,975.462 rows=0 loops=1)

84. 0.002 9,975.460 ↓ 0.0 0 1

Nested Loop Left Join (cost=6,807.18..20,331.74 rows=1 width=1,545) (actual time=9,975.460..9,975.460 rows=0 loops=1)

85. 0.001 9,975.458 ↓ 0.0 0 1

Nested Loop Left Join (cost=6,806.75..20,331.24 rows=1 width=1,540) (actual time=9,975.458..9,975.458 rows=0 loops=1)

86. 0.002 9,975.457 ↓ 0.0 0 1

Nested Loop Left Join (cost=6,805.93..20,330.24 rows=1 width=1,472) (actual time=9,975.457..9,975.457 rows=0 loops=1)

87. 0.003 9,975.455 ↓ 0.0 0 1

Nested Loop Left Join (cost=6,805.65..20,328.61 rows=1 width=1,426) (actual time=9,975.455..9,975.455 rows=0 loops=1)

88. 0.002 9,975.452 ↓ 0.0 0 1

Nested Loop Left Join (cost=6,805.50..20,328.36 rows=1 width=1,426) (actual time=9,975.452..9,975.452 rows=0 loops=1)

89. 0.001 9,975.450 ↓ 0.0 0 1

Nested Loop Left Join (cost=6,805.35..20,328.18 rows=1 width=1,426) (actual time=9,975.450..9,975.450 rows=0 loops=1)

90. 0.002 9,975.449 ↓ 0.0 0 1

Nested Loop Left Join (cost=6,805.07..20,326.55 rows=1 width=1,380) (actual time=9,975.449..9,975.449 rows=0 loops=1)

91. 0.002 9,975.447 ↓ 0.0 0 1

Nested Loop Left Join (cost=6,804.92..20,326.30 rows=1 width=1,380) (actual time=9,975.447..9,975.447 rows=0 loops=1)

92. 0.002 9,975.445 ↓ 0.0 0 1

Nested Loop Left Join (cost=6,804.78..20,326.12 rows=1 width=1,380) (actual time=9,975.445..9,975.445 rows=0 loops=1)

93. 0.001 9,975.443 ↓ 0.0 0 1

Nested Loop Left Join (cost=6,804.64..20,325.96 rows=1 width=1,358) (actual time=9,975.443..9,975.443 rows=0 loops=1)

94. 0.003 9,975.442 ↓ 0.0 0 1

Nested Loop Left Join (cost=6,804.35..20,325.61 rows=1 width=1,290) (actual time=9,975.442..9,975.442 rows=0 loops=1)

95. 0.001 9,975.439 ↓ 0.0 0 1

Nested Loop Left Join (cost=6,804.06..20,325.09 rows=1 width=1,274) (actual time=9,975.439..9,975.439 rows=0 loops=1)

96. 0.004 9,975.438 ↓ 0.0 0 1

Nested Loop Left Join (cost=6,803.78..20,324.57 rows=1 width=1,266) (actual time=9,975.438..9,975.438 rows=0 loops=1)

97. 0.002 9,975.434 ↓ 0.0 0 1

Nested Loop Left Join (cost=6,803.64..20,324.41 rows=1 width=1,268) (actual time=9,975.434..9,975.434 rows=0 loops=1)

98. 0.002 9,975.432 ↓ 0.0 0 1

Nested Loop Left Join (cost=6,803.50..20,324.25 rows=1 width=1,270) (actual time=9,975.432..9,975.432 rows=0 loops=1)

99. 0.002 9,975.430 ↓ 0.0 0 1

Nested Loop Left Join (cost=6,803.23..20,323.94 rows=1 width=1,266) (actual time=9,975.430..9,975.430 rows=0 loops=1)

100. 0.002 9,975.428 ↓ 0.0 0 1

Nested Loop Left Join (cost=6,802.80..20,323.40 rows=1 width=1,243) (actual time=9,975.428..9,975.428 rows=0 loops=1)

101. 0.002 9,975.426 ↓ 0.0 0 1

Nested Loop Left Join (cost=6,802.67..20,323.24 rows=1 width=1,219) (actual time=9,975.426..9,975.426 rows=0 loops=1)

102. 0.002 9,975.424 ↓ 0.0 0 1

Nested Loop Left Join (cost=6,802.38..20,322.92 rows=1 width=1,215) (actual time=9,975.424..9,975.424 rows=0 loops=1)

103. 0.001 9,975.422 ↓ 0.0 0 1

Nested Loop Left Join (cost=6,802.10..20,322.38 rows=1 width=1,214) (actual time=9,975.422..9,975.422 rows=0 loops=1)

104. 0.002 9,975.421 ↓ 0.0 0 1

Nested Loop Left Join (cost=6,801.81..20,322.05 rows=1 width=1,214) (actual time=9,975.421..9,975.421 rows=0 loops=1)

105. 0.002 9,975.419 ↓ 0.0 0 1

Nested Loop Left Join (cost=6,801.53..20,321.74 rows=1 width=1,204) (actual time=9,975.419..9,975.419 rows=0 loops=1)

106. 0.002 9,975.417 ↓ 0.0 0 1

Nested Loop Left Join (cost=6,801.40..20,321.58 rows=1 width=1,197) (actual time=9,975.417..9,975.417 rows=0 loops=1)

107. 0.002 9,975.415 ↓ 0.0 0 1

Nested Loop Left Join (cost=6,801.26..20,321.41 rows=1 width=1,182) (actual time=9,975.415..9,975.415 rows=0 loops=1)

108. 0.001 9,975.413 ↓ 0.0 0 1

Nested Loop Left Join (cost=6,801.12..20,321.24 rows=1 width=1,162) (actual time=9,975.413..9,975.413 rows=0 loops=1)

109. 0.002 9,975.412 ↓ 0.0 0 1

Nested Loop Left Join (cost=6,800.70..20,320.53 rows=1 width=1,146) (actual time=9,975.412..9,975.412 rows=0 loops=1)

110. 0.008 9,975.410 ↓ 0.0 0 1

Hash Join (cost=6,800.41..20,320.22 rows=1 width=1,142) (actual time=9,975.410..9,975.410 rows=0 loops=1)

  • Hash Cond: ((c.id)::integer = (r.car_id)::integer)
111. 0.000 0.000 ↓ 0.0 0

Hash Left Join (cost=6,791.59..19,979.14 rows=88,599 width=370) (never executed)

  • 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)
112. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=6,789.78..19,042.61 rows=88,599 width=341) (never executed)

113. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=1.54..1.56 rows=1 width=37) (never executed)

114. 0.000 0.000 ↓ 0.0 0

Seq Scan on vehicles_statuses_types vst (cost=0.00..1.36 rows=36 width=37) (never executed)

115. 0.000 0.000 ↓ 0.0 0

Hash Left Join (cost=6,788.24..18,155.05 rows=88,599 width=309) (never executed)

  • Hash Cond: ((c.trailer_id)::integer = (ts.trailer_id)::integer)
116. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=6,225.14..17,060.10 rows=88,599 width=305) (never executed)

  • Hash Cond: ((c.id)::integer = (cs.car_id)::integer)
117. 0.000 0.000 ↓ 0.0 0

Hash Left Join (cost=3,610.66..13,227.39 rows=88,599 width=281) (never executed)

  • Hash Cond: ((c.gps_device_id)::integer = (rusc.gps_device_id)::integer)
118. 0.000 0.000 ↓ 0.0 0

Hash Left Join (cost=3,186.75..12,398.44 rows=88,599 width=271) (never executed)

  • Hash Cond: ((c.warm_type_id)::integer = (wt_c.id)::integer)
119. 0.000 0.000 ↓ 0.0 0

Hash Left Join (cost=3,185.61..11,179.07 rows=88,599 width=264) (never executed)

  • Hash Cond: (c.temperature_sensor_model_id = tsm_c.id)
120. 0.000 0.000 ↓ 0.0 0

Hash Left Join (cost=3,184.10..10,821.84 rows=88,599 width=249) (never executed)

  • Hash Cond: ((c.autocades_id)::integer = (a.id)::integer)
121. 0.000 0.000 ↓ 0.0 0

Hash Left Join (cost=3,168.19..10,406.14 rows=88,599 width=244) (never executed)

  • Hash Cond: ((c.company_owner_id)::integer = (c_cto.id)::integer)
122. 0.000 0.000 ↓ 0.0 0

Hash Left Join (cost=3,092.60..9,112.32 rows=88,599 width=206) (never executed)

  • Hash Cond: ((c.car_trailer_brand_id)::integer = ctb_c.id)
123. 0.000 0.000 ↓ 0.0 0

Hash Left Join (cost=3,084.82..8,439.02 rows=88,599 width=186) (never executed)

  • Hash Cond: ((c.id)::integer = (cg.car_id)::integer)
124. 0.000 0.000 ↓ 0.0 0

Hash Left Join (cost=2,290.42..7,182.87 rows=88,599 width=162) (never executed)

  • Hash Cond: ((c.type_delivery)::integer = dtt.id)
125. 0.000 0.000 ↓ 0.0 0

Hash Left Join (cost=2,289.27..5,963.47 rows=88,599 width=149) (never executed)

  • Hash Cond: ((c.phone_id)::integer = (ph.id)::integer)
126. 0.000 0.000 ↓ 0.0 0

Seq Scan on cars c (cost=0.00..3,292.99 rows=88,599 width=133) (never executed)

127. 0.000 0.000 ↓ 0.0 0

Hash (cost=2,148.72..2,148.72 rows=11,244 width=28) (never executed)

128. 0.000 0.000 ↓ 0.0 0

Hash Left Join (cost=1,321.75..2,148.72 rows=11,244 width=28) (never executed)

  • Hash Cond: ((ph.simcard_abroad_id)::integer = (sim_abroad.id)::integer)
129. 0.000 0.000 ↓ 0.0 0

Hash Right Join (cost=362.99..1,146.73 rows=11,244 width=20) (never executed)

  • Hash Cond: ((sim.id)::integer = (ph.simcard_id)::integer)
130. 0.000 0.000 ↓ 0.0 0

Seq Scan on simcards sim (cost=0.00..570.56 rows=31,056 width=16) (never executed)

131. 0.000 0.000 ↓ 0.0 0

Hash (cost=222.44..222.44 rows=11,244 width=12) (never executed)

132. 0.000 0.000 ↓ 0.0 0

Seq Scan on phones ph (cost=0.00..222.44 rows=11,244 width=12) (never executed)

133. 0.000 0.000 ↓ 0.0 0

Hash (cost=570.56..570.56 rows=31,056 width=16) (never executed)

134. 0.000 0.000 ↓ 0.0 0

Seq Scan on simcards sim_abroad (cost=0.00..570.56 rows=31,056 width=16) (never executed)

135. 0.000 0.000 ↓ 0.0 0

Hash (cost=1.07..1.07 rows=7 width=21) (never executed)

136. 0.000 0.000 ↓ 0.0 0

Seq Scan on deliveries_types dtt (cost=0.00..1.07 rows=7 width=21) (never executed)

137. 0.000 0.000 ↓ 0.0 0

Hash (cost=632.51..632.51 rows=12,951 width=28) (never executed)

138. 0.000 0.000 ↓ 0.0 0

Seq Scan on cars_gps cg (cost=0.00..632.51 rows=12,951 width=28) (never executed)

139. 0.000 0.000 ↓ 0.0 0

Hash (cost=5.68..5.68 rows=168 width=28) (never executed)

140. 0.000 0.000 ↓ 0.0 0

Seq Scan on cars_trailers_brands ctb_c (cost=0.00..5.68 rows=168 width=28) (never executed)

141. 0.000 0.000 ↓ 0.0 0

Hash (cost=60.26..60.26 rows=1,226 width=46) (never executed)

142. 0.000 0.000 ↓ 0.0 0

Seq Scan on cars_trailers_owners c_cto (cost=0.00..60.26 rows=1,226 width=46) (never executed)

143. 0.000 0.000 ↓ 0.0 0

Hash (cost=10.96..10.96 rows=396 width=13) (never executed)

144. 0.000 0.000 ↓ 0.0 0

Seq Scan on autocades a (cost=0.00..10.96 rows=396 width=13) (never executed)

145. 0.000 0.000 ↓ 0.0 0

Hash (cost=1.23..1.23 rows=23 width=23) (never executed)

146. 0.000 0.000 ↓ 0.0 0

Seq Scan on temperature_sensor_models tsm_c (cost=0.00..1.23 rows=23 width=23) (never executed)

147. 0.000 0.000 ↓ 0.0 0

Hash (cost=1.06..1.06 rows=6 width=15) (never executed)

148. 0.000 0.000 ↓ 0.0 0

Seq Scan on warm_types wt_c (cost=0.00..1.06 rows=6 width=15) (never executed)

149. 0.000 0.000 ↓ 0.0 0

Hash (cost=322.85..322.85 rows=8,085 width=14) (never executed)

150. 0.000 0.000 ↓ 0.0 0

Seq Scan on refrigeration_unit_status rusc (cost=0.00..322.85 rows=8,085 width=14) (never executed)

151. 0.000 0.000 ↓ 0.0 0

Hash (cost=1,506.99..1,506.99 rows=88,599 width=24) (never executed)

152. 0.000 0.000 ↓ 0.0 0

Seq Scan on cars_statuses cs (cost=0.00..1,506.99 rows=88,599 width=24) (never executed)

153. 0.000 0.000 ↓ 0.0 0

Hash (cost=313.60..313.60 rows=19,960 width=8) (never executed)

154. 0.000 0.000 ↓ 0.0 0

Seq Scan on trailers_statuses ts (cost=0.00..313.60 rows=19,960 width=8) (never executed)

155. 0.000 0.000 ↓ 0.0 0

Hash (cost=1.36..1.36 rows=36 width=37) (never executed)

156. 0.000 0.000 ↓ 0.0 0

Seq Scan on vehicles_statuses_types vst2 (cost=0.00..1.36 rows=36 width=37) (never executed)

157. 0.002 9,975.402 ↓ 0.0 0 1

Hash (cost=8.81..8.81 rows=1 width=780) (actual time=9,975.402..9,975.402 rows=0 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
158. 0.002 9,975.400 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.70..8.81 rows=1 width=780) (actual time=9,975.400..9,975.400 rows=0 loops=1)

  • Join Filter: (r.opened IS TRUE)
159. 0.001 9,975.398 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.57..8.65 rows=1 width=735) (actual time=9,975.398..9,975.398 rows=0 loops=1)

160. 0.002 9,975.397 ↓ 0.0 0 1

Nested Loop (cost=0.43..8.48 rows=1 width=692) (actual time=9,975.397..9,975.397 rows=0 loops=1)

161. 9,975.395 9,975.395 ↓ 0.0 0 1

CTE Scan on cr_rpa cp_rpa (cost=0.00..0.02 rows=1 width=357) (actual time=9,975.395..9,975.395 rows=0 loops=1)

162. 0.000 0.000 ↓ 0.0 0

Index Scan using routes_pkey on routes r (cost=0.43..8.45 rows=1 width=339) (never executed)

  • Index Cond: ((id)::integer = (cp_rpa.route_id)::integer)
163. 0.000 0.000 ↓ 0.0 0

Index Scan using delivery_acception_statuses_pkey on delivery_acception_statuses das (cost=0.14..0.16 rows=1 width=52) (never executed)

  • Index Cond: (id = r.delivery_acception_status)
  • Filter: (accepted = r.general_delivery_acception)
164. 0.000 0.000 ↓ 0.0 0

Index Scan using route_acception_statuses_pkey on route_acception_statuses ras (cost=0.13..0.15 rows=1 width=49) (never executed)

  • Index Cond: (id = r.route_acception_status)
  • Filter: (NOT (accepted IS DISTINCT FROM r.general_route_acception))
165. 0.000 0.000 ↓ 0.0 0

Index Scan using arm_de_tablet_car_id_idx on tablet de_t (cost=0.28..0.30 rows=1 width=8) (never executed)

  • Index Cond: ((car_id)::integer = (c.id)::integer)
166. 0.000 0.000 ↓ 0.0 0

Index Scan using trailers_pkey on trailers t (cost=0.42..0.70 rows=1 width=20) (never executed)

  • Index Cond: ((id)::integer = (c.trailer_id)::integer)
167. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_cars_trailers_brands on cars_trailers_brands ctb_t (cost=0.14..0.16 rows=1 width=28) (never executed)

  • Index Cond: (id = (t.car_trailer_brand_id)::integer)
168. 0.000 0.000 ↓ 0.0 0

Index Scan using temperature_sensor_models_pkey on temperature_sensor_models tsm_t (cost=0.14..0.16 rows=1 width=23) (never executed)

  • Index Cond: (t.temperature_sensor_model_id = id)
169. 0.000 0.000 ↓ 0.0 0

Index Scan using warm_types_pkey on warm_types wt_t (cost=0.13..0.15 rows=1 width=15) (never executed)

  • Index Cond: ((id)::integer = (t.warm_type_id)::integer)
170. 0.000 0.000 ↓ 0.0 0

Index Scan using refrigeration_unit_status_pkey on refrigeration_unit_status rust (cost=0.28..0.30 rows=1 width=14) (never executed)

  • Index Cond: ((gps_device_id)::integer = (t.gps_device_id)::integer)
171. 0.000 0.000 ↓ 0.0 0

Index Only Scan using gps_devices_pkey on gps_devices gdc (cost=0.29..0.31 rows=1 width=4) (never executed)

  • Index Cond: (id = (c.gps_device_id)::integer)
  • Heap Fetches: 0
172. 0.000 0.000 ↓ 0.0 0

Index Scan using gps_devices_extra_fields2_pkey on gps_devices_extra_fields2 ef2 (cost=0.29..0.54 rows=1 width=5) (never executed)

  • Index Cond: ((gps_device_id)::integer = (gdc.id)::integer)
173. 0.000 0.000 ↓ 0.0 0

Index Scan using gps_devices_pkey on gps_devices gdt (cost=0.29..0.31 rows=1 width=8) (never executed)

  • Index Cond: ((id)::integer = (t.gps_device_id)::integer)
174. 0.000 0.000 ↓ 0.0 0

Index Scan using gps_devices_models_pkey on gps_devices_models gdmt (cost=0.13..0.15 rows=1 width=32) (never executed)

  • Index Cond: ((id)::integer = (gdt.gps_devices_model_id)::integer)
175. 0.000 0.000 ↓ 0.0 0

Index Scan using routes_extra_fields_idx on routes_extra_fields ref (cost=0.43..0.54 rows=1 width=27) (never executed)

  • Index Cond: ((route_id)::integer = (r.id)::integer)
176. 0.000 0.000 ↓ 0.0 0

Index Scan using history_auto_open_routes_idx on history_auto_open_routes haor (cost=0.27..0.29 rows=1 width=8) (never executed)

  • Index Cond: ((route_id)::integer = (r.id)::integer)
  • Filter: (auto_open_type_id = 1)
177. 0.000 0.000 ↓ 0.0 0

Index Scan using cars_models_pkey on cars_models cm (cost=0.14..0.16 rows=1 width=6) (never executed)

  • Index Cond: ((id)::integer = (r.car_model_id)::integer)
178. 0.000 0.000 ↓ 0.0 0

Index Scan using trailers_models_pkey on trailers_models tm (cost=0.14..0.15 rows=1 width=6) (never executed)

  • Index Cond: ((id)::integer = (r.trailer_model_id)::integer)
179. 0.000 0.000 ↓ 0.0 0

Index Scan using malfunction_extra_fields_pkey on malfunction_extra_fields mefc (cost=0.29..0.51 rows=1 width=16) (never executed)

  • Index Cond: (gps_device_id = (gdc.id)::integer)
180. 0.000 0.000 ↓ 0.0 0

Index Scan using malfunction_extra_fields_pkey on malfunction_extra_fields meft (cost=0.29..0.51 rows=1 width=24) (never executed)

  • Index Cond: (gps_device_id = (gdt.id)::integer)
181. 0.000 0.000 ↓ 0.0 0

Index Scan using cch_route_idx on car_comments_history cch (cost=0.29..0.33 rows=2 width=72) (never executed)

  • Index Cond: (route_id = (r.id)::integer)
182. 0.000 0.000 ↓ 0.0 0

Index Scan using car_comment_templates_pkey on car_comment_templates cct (cost=0.14..0.16 rows=1 width=30) (never executed)

  • Index Cond: (id = cch.comment_template)
183. 0.000 0.000 ↓ 0.0 0

Index Scan using autocades_pkey on autocades native_autocade (cost=0.15..0.17 rows=1 width=8) (never executed)

  • Index Cond: ((id)::integer = (c.autocades_id)::integer)
184. 0.000 0.000 ↓ 0.0 0

Index Scan using autocades_managers_pkey on autocades_managers native_manager (cost=0.15..0.25 rows=1 width=8) (never executed)

  • Index Cond: ((id)::integer = (native_autocade.autocades_managers_id)::integer)
185. 0.000 0.000 ↓ 0.0 0

Index Scan using users2_pkey on users native_user (cost=0.28..1.62 rows=1 width=54) (never executed)

  • Index Cond: (user_oid = (native_manager.user_oid)::oid)
186. 0.000 0.000 ↓ 0.0 0

Index Scan using autocades_pkey on autocades prikom_ak (cost=0.15..0.17 rows=1 width=8) (never executed)

  • Index Cond: ((id)::integer = (c.receiver_autocade_id)::integer)
187. 0.000 0.000 ↓ 0.0 0

Index Scan using autocades_managers_pkey on autocades_managers am_prikom (cost=0.15..0.25 rows=1 width=8) (never executed)

  • Index Cond: ((id)::integer = (prikom_ak.autocades_managers_id)::integer)
188. 0.000 0.000 ↓ 0.0 0

Index Scan using users2_pkey on users am_prikom_u (cost=0.28..1.62 rows=1 width=54) (never executed)

  • Index Cond: (user_oid = (am_prikom.user_oid)::oid)
189. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=0.82..0.99 rows=1 width=72) (never executed)

190. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=0.69..0.84 rows=1 width=39) (never executed)

191. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.56..0.68 rows=1 width=15) (never executed)

192. 0.000 0.000 ↓ 0.0 0

Index Scan using route_pkey on route r_1 (cost=0.43..0.52 rows=1 width=19) (never executed)

  • Index Cond: ((route_id)::integer = (r.id)::integer)
193. 0.000 0.000 ↓ 0.0 0

Index Only Scan using route_state_pkey on route_state (cost=0.13..0.15 rows=1 width=4) (never executed)

  • Index Cond: (id = (r_1.state_id)::integer)
  • Heap Fetches: 0
194. 0.000 0.000 ↓ 0.0 0

Index Scan using event_delivery_cause_pkey on event_delivery_cause edc (cost=0.13..0.15 rows=1 width=32) (never executed)

  • Index Cond: ((id)::integer = (r_1.delivery_cause_id)::integer)
195. 0.000 0.000 ↓ 0.0 0

Index Scan using event_route_cause_pkey on event_route_cause rc (cost=0.13..0.15 rows=1 width=41) (never executed)

  • Index Cond: ((id)::integer = (r_1.route_cause_id)::integer)
196. 0.000 0.000 ↓ 0.0 0

Index Scan using route_backward_pkey on route_backward de_rb (cost=0.43..0.49 rows=1 width=9) (never executed)

  • Index Cond: ((route_id)::integer = (r.id)::integer)
197. 0.000 0.000 ↓ 0.0 0

Index Scan using event_route_cause_pkey on event_route_cause de_erc (cost=0.13..0.15 rows=1 width=41) (never executed)

  • Index Cond: ((id)::integer = (de_rb.cancel_cause_id)::integer)
198. 0.000 0.000 ↓ 0.0 0

Index Scan using routes_dc_times_detail_idx on routes_dc_times_detail park0 (cost=0.43..0.56 rows=1 width=6) (never executed)

  • Index Cond: (((route_id)::integer = (r.id)::integer) AND (tr_type = 0))
199. 0.000 0.000 ↓ 0.0 0

Index Scan using routes_dc_times_detail_idx on routes_dc_times_detail park1 (cost=0.43..0.56 rows=1 width=6) (never executed)

  • Index Cond: (((route_id)::integer = (r.id)::integer) AND (tr_type = 1))
200. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: ((route_id)::integer = (r.id)::integer)
201. 0.000 0.000 ↓ 0.0 0

Hash (cost=1.13..1.13 rows=13 width=7) (never executed)

202. 0.000 0.000 ↓ 0.0 0

Seq Scan on open_route_statuses ors (cost=0.00..1.13 rows=13 width=7) (never executed)

203. 0.000 0.000 ↓ 0.0 0

Seq Scan on future_route_statuses frs (cost=0.00..1.08 rows=8 width=7) (never executed)

204. 0.000 0.000 ↓ 0.0 0

Index Scan using route_id on escalation_answers ea (cost=0.42..0.44 rows=1 width=75) (never executed)

  • Index Cond: (route_id = (r.id)::integer)
205. 0.000 0.000 ↓ 0.0 0

Index Scan using escalation_answers_route_pkey on escalation_answers_route ear (cost=0.42..0.44 rows=1 width=67) (never executed)

  • Index Cond: (route_id = (r.id)::integer)
206. 0.000 0.000 ↓ 0.0 0

Seq Scan on routes_schemes rs (cost=0.00..1.03 rows=3 width=17) (never executed)

207.          

SubPlan (for Nested Loop Left Join)

208. 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
209. 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
210. 0.000 0.000 ↓ 0.0 0

Index Scan using cars_trailers_owners_pkey on cars_trailers_owners cto_1 (cost=0.28..8.29 rows=1 width=42) (never executed)

  • Index Cond: ((id)::integer = ref.open_receiver_owner_id)
211. 0.000 0.000 ↓ 0.0 0

Index Scan using autocades_pkey on autocades au (cost=0.15..8.17 rows=1 width=5) (never executed)

  • Index Cond: ((id)::integer = ref.open_receiver_autocade_id)
Planning time : 40.084 ms
Execution time : 9,979.143 ms