explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 3dJu

Settings
# exclusive inclusive rows x rows loops node
1. 0.010 26.619 ↑ 1.0 1 1

Nested Loop Left Join (cost=6,921.96..6,929.99 rows=1 width=353) (actual time=26.615..26.619 rows=1 loops=1)

  • Join Filter: (((tt_2.sub_region_id = wto.sub_region_id) OR ((tt_2.sub_region_id IS NULL) AND (wto.sub_region_id IS NULL))) AND (o_1.worker_id = w.id) AND (((tt_2.exclusive_origin_id = wto.exclusive_origin_id) AND (tt_2.origin_priority_type = wto.origin_priority_type)) OR ((tt_2.exclusive_origin_id IS NULL) AND (wto.exclusive_origin_id IS NULL))))
2.          

CTE worker_state_machine_trail

3. 0.374 0.374 ↓ 262.0 262 1

Index Scan using idx_state_machine_trail_id_type_smid_created_date on state_machine_trail (cost=0.71..4.82 rows=1 width=124) (actual time=0.031..0.374 rows=262 loops=1)

  • Index Cond: ((entity_id = 242396) AND (created_date >= (to_timestamp('2020-01-22 10:00:00'::text, 'YYYY-MM-DD HH24:MI:SS'::text) - '2 days'::interval)) AND (created_date <= (to_timestamp('2020-01-22 14:29:00'::text, 'YYYY-MM-DD HH24:MI:SS'::text) + '2 days'::interval)))
4.          

CTE workers_turn_on

5. 0.000 0.200 ↑ 1.0 1 1

Nested Loop (cost=40.69..171.73 rows=1 width=60) (actual time=0.199..0.200 rows=1 loops=1)

  • Join Filter: (e_1.id = ea_2.state_machine_event_id)
6.          

Initplan (for Nested Loop)

7. 0.009 0.009 ↑ 1.0 1 1

Index Scan using idx_attribute_key_name on attribute_key (cost=0.27..4.38 rows=1 width=8) (actual time=0.009..0.009 rows=1 loops=1)

  • Index Cond: ((name)::text = 'EXCLUSIVE_ORIGIN_ID'::text)
8. 0.008 0.008 ↑ 1.0 1 1

Index Scan using idx_attribute_key_name on attribute_key attribute_key_1 (cost=0.27..4.38 rows=1 width=8) (actual time=0.008..0.008 rows=1 loops=1)

  • Index Cond: ((name)::text = 'PRIORITY_ORIGIN_ID'::text)
9. 0.006 0.006 ↑ 1.0 1 1

Index Scan using idx_attribute_key_name on attribute_key attribute_key_2 (cost=0.27..4.38 rows=1 width=8) (actual time=0.006..0.006 rows=1 loops=1)

  • Index Cond: ((name)::text = 'SUB_REGION_ID'::text)
10. 0.012 0.012 ↑ 1.0 1 1

Index Scan using idx_attribute_key_name on attribute_key attribute_key_3 (cost=0.27..4.38 rows=1 width=8) (actual time=0.012..0.012 rows=1 loops=1)

  • Index Cond: ((name)::text = 'LOGISTICS_OPERATORS_ID'::text)
11. 0.012 0.012 ↑ 1.0 1 1

Index Scan using idx_subset_name on subset (cost=0.28..4.38 rows=1 width=8) (actual time=0.012..0.012 rows=1 loops=1)

  • Index Cond: ((name)::text = 'Operador Nuvem'::text)
12. 0.008 0.008 ↑ 1.0 1 1

Index Scan using idx_attribute_key_name on attribute_key attribute_key_4 (cost=0.27..4.38 rows=1 width=8) (actual time=0.006..0.008 rows=1 loops=1)

  • Index Cond: ((name)::text = 'TAG'::text)
13. 0.007 0.007 ↑ 1.0 1 1

Index Scan using idx_attribute_key_name on attribute_key attribute_key_5 (cost=0.27..4.38 rows=1 width=8) (actual time=0.007..0.007 rows=1 loops=1)

  • Index Cond: ((name)::text = 'SHIFT'::text)
14. 0.011 0.011 ↑ 1.0 1 1

Index Scan using idx_attribute_key_name on attribute_key attribute_key_6 (cost=0.27..4.38 rows=1 width=8) (actual time=0.011..0.011 rows=1 loops=1)

  • Index Cond: ((name)::text = 'REGION_ID'::text)
15. 0.008 0.177 ↑ 1.0 1 1

Nested Loop (cost=4.96..18.32 rows=1 width=80) (actual time=0.176..0.177 rows=1 loops=1)

  • Join Filter: (e_1.id = ea_1.state_machine_event_id)
16. 0.009 0.150 ↑ 1.0 1 1

Nested Loop (cost=4.25..15.10 rows=1 width=72) (actual time=0.149..0.150 rows=1 loops=1)

  • Join Filter: (e_1.id = ea.state_machine_event_id)
17. 0.008 0.123 ↑ 1.0 1 1

Nested Loop Left Join (cost=3.54..11.89 rows=1 width=64) (actual time=0.122..0.123 rows=1 loops=1)

18. 0.009 0.109 ↑ 1.0 1 1

Nested Loop Left Join (cost=2.83..10.13 rows=1 width=54) (actual time=0.108..0.109 rows=1 loops=1)

19. 0.010 0.094 ↑ 1.0 1 1

Nested Loop Left Join (cost=2.13..8.37 rows=1 width=44) (actual time=0.093..0.094 rows=1 loops=1)

20. 0.015 0.078 ↑ 1.0 1 1

Nested Loop (cost=1.42..6.61 rows=1 width=34) (actual time=0.077..0.078 rows=1 loops=1)

21. 0.032 0.032 ↑ 1.0 1 1

Index Scan using idx_state_machine_event_ei_et_ei_ed on state_machine_event e_1 (cost=0.71..4.83 rows=1 width=16) (actual time=0.031..0.032 rows=1 loops=1)

  • Index Cond: ((entity_id = 242396) AND ((entity_type)::text = 'WORKER'::text) AND ((event_id)::text = 'TURN_ON'::text) AND (event_date >= to_timestamp('2020-01-22 10:00:00'::text, 'YYYY-MM-DD HH24:MI:SS'::text)) AND (event_date <= to_timestamp('2020-01-22 14:29:00'::text, 'YYYY-MM-DD HH24:MI:SS'::text)))
  • Filter: ((event_status)::text = 'ACCEPTED'::text)
22. 0.031 0.031 ↑ 110.0 1 1

Index Scan using state_machine_event_attribute_state_machine_event_id_attrib_key on state_machine_event_attribute logistics_operators_id (cost=0.71..118.47 rows=110 width=18) (actual time=0.031..0.031 rows=1 loops=1)

  • Index Cond: ((state_machine_event_id = e_1.id) AND (attribute_key_id = $4))
  • Filter: ((value)::integer <> $5)
23. 0.006 0.006 ↓ 0.0 0 1

Index Scan using state_machine_event_attribute_state_machine_event_id_attrib_key on state_machine_event_attribute e_exclusive_origin_id (cost=0.71..117.64 rows=111 width=18) (actual time=0.006..0.006 rows=0 loops=1)

  • Index Cond: ((e_1.id = state_machine_event_id) AND (attribute_key_id = $1))
24. 0.006 0.006 ↓ 0.0 0 1

Index Scan using state_machine_event_attribute_state_machine_event_id_attrib_key on state_machine_event_attribute e_priority_origin_id (cost=0.71..117.64 rows=111 width=18) (actual time=0.006..0.006 rows=0 loops=1)

  • Index Cond: ((e_1.id = state_machine_event_id) AND (attribute_key_id = $2))
25. 0.006 0.006 ↓ 0.0 0 1

Index Scan using state_machine_event_attribute_state_machine_event_id_attrib_key on state_machine_event_attribute e_sub_regions_id (cost=0.71..117.64 rows=111 width=18) (actual time=0.006..0.006 rows=0 loops=1)

  • Index Cond: ((e_1.id = state_machine_event_id) AND (attribute_key_id = $3))
26. 0.018 0.018 ↑ 1.0 1 1

Index Only Scan using idx_state_machine_event_attribute_attribute_key_id_value on state_machine_event_attribute ea (cost=0.71..3.11 rows=1 width=8) (actual time=0.018..0.018 rows=1 loops=1)

  • Index Cond: ((attribute_key_id = $6) AND (value = 'REGULAR'::text) AND (state_machine_event_id = logistics_operators_id.state_machine_event_id))
  • Heap Fetches: 1
27. 0.019 0.019 ↑ 1.0 1 1

Index Only Scan using idx_state_machine_event_attribute_attribute_key_id_value on state_machine_event_attribute ea_1 (cost=0.71..3.11 rows=1 width=8) (actual time=0.019..0.019 rows=1 loops=1)

  • Index Cond: ((attribute_key_id = $7) AND (value = 'ALMOCO LOOP BSB'::text) AND (state_machine_event_id = logistics_operators_id.state_machine_event_id))
  • Heap Fetches: 1
28. 0.009 0.009 ↑ 1.0 1 1

Index Scan using state_machine_event_attribute_state_machine_event_id_attrib_key on state_machine_event_attribute ea_2 (cost=0.71..118.26 rows=1 width=8) (actual time=0.008..0.009 rows=1 loops=1)

  • Index Cond: ((state_machine_event_id = logistics_operators_id.state_machine_event_id) AND (attribute_key_id = $8))
  • Filter: ((value)::integer = 8)
29.          

CTE shift_orders

30. 0.015 1.117 ↓ 16.0 16 1

Nested Loop (cost=1.14..2,234.49 rows=1 width=806) (actual time=0.357..1.117 rows=16 loops=1)

31. 1.022 1.022 ↓ 16.0 16 1

Index Scan using idx_order_delivery_worker_id on order_delivery o_2 (cost=0.57..2,229.81 rows=1 width=806) (actual time=0.343..1.022 rows=16 loops=1)

  • Index Cond: (worker_id = 242396)
  • Filter: (((shift)::text = 'ALMOCO LOOP BSB'::text) AND (created_date <= to_timestamp('2020-01-22 14:29:00'::text, 'YYYY-MM-DD HH24:MI:SS'::text)) AND (created_date >= ((to_date('2020-01-22'::text, 'YYYY-MM-DD'::text) - 4))::timestamp without time zone))
  • Rows Removed by Filter: 737
32. 0.080 0.080 ↑ 1.0 1 16

Index Only Scan using order_subset_pkey on order_subset os (cost=0.57..4.68 rows=1 width=8) (actual time=0.005..0.005 rows=1 loops=16)

  • Index Cond: ((order_id = o_2.id) AND (subset_id = 8))
  • Heap Fetches: 16
33.          

CTE turn_on_turn_off_times

34. 0.001 0.539 ↑ 1.0 1 1

Unique (cost=0.97..0.99 rows=1 width=72) (actual time=0.538..0.539 rows=1 loops=1)

35. 0.010 0.538 ↑ 1.0 1 1

Sort (cost=0.97..0.98 rows=1 width=72) (actual time=0.538..0.538 rows=1 loops=1)

  • Sort Key: workers_turn_on.worker_id, workers_turn_on.exclusive_origin_id, workers_turn_on.origin_priority_type, workers_turn_on.sub_region_id, (GREATEST((max(turn_on.created_date))::timestamp with time zone, to_timestamp('2020-01-22 10:00:00'::text, 'YYYY-MM-DD HH24:MI:SS'::text))), (LEAST((min(turn_off.created_date))::timestamp with time zone, to_timestamp('2020-01-22 14:29:00'::text, 'YYYY-MM-DD HH24:MI:SS'::text)))
  • Sort Method: quicksort Memory: 25kB
36. 0.008 0.528 ↑ 1.0 1 1

HashAggregate (cost=0.85..0.96 rows=1 width=72) (actual time=0.528..0.528 rows=1 loops=1)

  • Group Key: turn_on.id, workers_turn_on.worker_id, workers_turn_on.exclusive_origin_id, workers_turn_on.origin_priority_type, workers_turn_on.sub_region_id
  • Filter: (GREATEST((max(turn_on.created_date))::timestamp with time zone, to_timestamp('2020-01-22 10:00:00'::text, 'YYYY-MM-DD HH24:MI:SS'::text)) < LEAST((min(turn_off.created_date))::timestamp with time zone, to_timestamp('2020-01-22 14:29:00'::text, 'YYYY-MM-DD HH24:MI:SS'::text)))
37. 0.002 0.520 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.00..0.82 rows=1 width=72) (actual time=0.500..0.520 rows=1 loops=1)

  • Join Filter: ((turn_on.created_date < turn_off.created_date) AND (turn_on.entity_id = turn_off.entity_id))
  • Rows Removed by Join Filter: 2
38. 0.002 0.228 ↑ 1.0 1 1

Nested Loop (cost=0.00..0.51 rows=1 width=72) (actual time=0.209..0.228 rows=1 loops=1)

  • Join Filter: (workers_turn_on.event_id = turn_on.event_id)
  • Rows Removed by Join Filter: 4
39. 0.000 0.000 ↑ 1.0 1 1

CTE Scan on workers_turn_on (cost=0.00..0.20 rows=1 width=56) (actual time=0.000..0.000 rows=1 loops=1)

40. 0.226 0.226 ↓ 5.0 5 1

CTE Scan on worker_state_machine_trail turn_on (cost=0.00..0.21 rows=1 width=32) (actual time=0.075..0.226 rows=5 loops=1)

  • Filter: (((state_machine_id)::text = 'WORKER_SHIFT_STATE_MACHINE'::text) AND (created_date < to_timestamp('2020-01-22 14:29:00'::text, 'YYYY-MM-DD HH24:MI:SS'::text)))
  • Rows Removed by Filter: 257
41. 0.290 0.290 ↓ 2.0 2 1

CTE Scan on worker_state_machine_trail turn_off (cost=0.00..0.21 rows=1 width=16) (actual time=0.011..0.290 rows=2 loops=1)

  • Filter: (((current_state)::text = 'OFF_SHIFT'::text) AND ((state_machine_id)::text = 'WORKER_SHIFT_STATE_MACHINE'::text) AND (created_date < to_timestamp('2020-01-22 14:29:00'::text, 'YYYY-MM-DD HH24:MI:SS'::text)))
  • Rows Removed by Filter: 260
42.          

CTE workers_on_shift_on_off_times

43. 0.002 0.687 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.97..1.41 rows=1 width=64) (actual time=0.687..0.687 rows=1 loops=1)

  • Join Filter: (((wto_1.sub_region_id = tt_3.sub_region_id) OR ((wto_1.sub_region_id IS NULL) AND (tt_3.sub_region_id IS NULL))) AND ""overlaps""(COALESCE((GREATEST((max(on_trail.created_date))::timestamp with time zone, to_timestamp('2020-01-22 10:00:00'::text, 'YYYY-MM-DD HH24:MI:SS'::text))), tt_3.turn_on_time), COALESCE((LEAST((min(off_trail.created_date))::timestamp with time zone, to_timestamp('2020-01-22 14:29:00'::text, 'YYYY-MM-DD HH24:MI:SS'::text))), tt_3.turn_off_time), tt_3.turn_on_time, tt_3.turn_off_time) AND (wto_1.worker_id = tt_3.worker_id) AND (((wto_1.exclusive_origin_id = tt_3.exclusive_origin_id) AND (wto_1.origin_priority_type = tt_3.origin_priority_type)) OR ((wto_1.exclusive_origin_id IS NULL) AND (tt_3.exclusive_origin_id IS NULL))))
44. 0.000 0.000 ↑ 1.0 1 1

CTE Scan on turn_on_turn_off_times tt_3 (cost=0.00..0.20 rows=1 width=64) (actual time=0.000..0.000 rows=1 loops=1)

45. 0.000 0.685 ↑ 1.0 1 1

Unique (cost=0.97..0.99 rows=1 width=72) (actual time=0.685..0.685 rows=1 loops=1)

46. 0.006 0.685 ↑ 1.0 1 1

Sort (cost=0.97..0.97 rows=1 width=72) (actual time=0.684..0.685 rows=1 loops=1)

  • Sort Key: wto_1.worker_id, wto_1.exclusive_origin_id, wto_1.origin_priority_type, wto_1.sub_region_id, (GREATEST((max(on_trail.created_date))::timestamp with time zone, to_timestamp('2020-01-22 10:00:00'::text, 'YYYY-MM-DD HH24:MI:SS'::text))), (LEAST((min(off_trail.created_date))::timestamp with time zone, to_timestamp('2020-01-22 14:29:00'::text, 'YYYY-MM-DD HH24:MI:SS'::text)))
  • Sort Method: quicksort Memory: 25kB
47. 0.075 0.679 ↑ 1.0 1 1

HashAggregate (cost=0.84..0.96 rows=1 width=72) (actual time=0.665..0.679 rows=1 loops=1)

  • Group Key: on_trail.id, wto_1.worker_id, wto_1.exclusive_origin_id, wto_1.origin_priority_type, wto_1.sub_region_id
  • Filter: (GREATEST((max(on_trail.created_date))::timestamp with time zone, to_timestamp('2020-01-22 10:00:00'::text, 'YYYY-MM-DD HH24:MI:SS'::text)) < LEAST((min(off_trail.created_date))::timestamp with time zone, to_timestamp('2020-01-22 14:29:00'::text, 'YYYY-MM-DD HH24:MI:SS'::text)))
  • Rows Removed by Filter: 16
48. 0.050 0.604 ↓ 238.0 238 1

Nested Loop Left Join (cost=0.00..0.82 rows=1 width=72) (actual time=0.007..0.604 rows=238 loops=1)

  • Join Filter: ((on_trail.created_date < off_trail.created_date) AND (on_trail.entity_id = off_trail.entity_id))
  • Rows Removed by Join Filter: 136
49. 0.003 0.044 ↓ 17.0 17 1

Nested Loop (cost=0.00..0.51 rows=1 width=72) (actual time=0.004..0.044 rows=17 loops=1)

  • Join Filter: (wto_1.worker_id = on_trail.entity_id)
50. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on workers_turn_on wto_1 (cost=0.00..0.20 rows=1 width=48) (actual time=0.000..0.001 rows=1 loops=1)

51. 0.040 0.040 ↓ 17.0 17 1

CTE Scan on worker_state_machine_trail on_trail (cost=0.00..0.21 rows=1 width=24) (actual time=0.003..0.040 rows=17 loops=1)

  • Filter: (((current_state)::text = 'ONLINE'::text) AND ((state_machine_id)::text = 'WORKER_CONNECTIVITY_STATE_MACHINE'::text) AND (created_date < to_timestamp('2020-01-22 14:29:00'::text, 'YYYY-MM-DD HH24:MI:SS'::text)))
  • Rows Removed by Filter: 245
52. 0.510 0.510 ↓ 22.0 22 17

CTE Scan on worker_state_machine_trail off_trail (cost=0.00..0.21 rows=1 width=16) (actual time=0.001..0.030 rows=22 loops=17)

  • Filter: (((current_state)::text = 'OFFLINE'::text) AND ((state_machine_id)::text = 'WORKER_CONNECTIVITY_STATE_MACHINE'::text))
  • Rows Removed by Filter: 240
53.          

CTE workers_on_shift_block_unblock_times

54. 0.006 0.160 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.84..1.38 rows=1 width=64) (actual time=0.160..0.160 rows=0 loops=1)

  • Join Filter: ((((max(wto_2.sub_region_id)) = oo_1.sub_region_id) OR (((max(wto_2.sub_region_id)) IS NULL) AND (oo_1.sub_region_id IS NULL))) AND ((max(wto_2.worker_id)) = oo_1.worker_id) AND ((((max(wto_2.exclusive_origin_id)) = oo_1.exclusive_origin_id) AND ((max(wto_2.origin_priority_type)) = oo_1.origin_priority_type)) OR (((max(wto_2.exclusive_origin_id)) IS NULL) AND (oo_1.exclusive_origin_id IS NULL))))
  • Filter: ((CASE WHEN (((min(block.created_date)) < oo_1.on_time) OR (((min(block.created_date)) IS NULL) AND ((min(unblock.created_date)) IS NOT NULL))) THEN oo_1.on_time ELSE ((min(block.created_date)))::timestamp with time zone END IS NOT NULL) AND (CASE WHEN (((min(unblock.created_date)) > oo_1.off_time) OR (((min(unblock.created_date)) IS NULL) AND ((min(block.created_date)) IS NOT NULL))) THEN oo_1.off_time ELSE ((min(unblock.created_date)))::timestamp with time zone END IS NOT NULL) AND ""overlaps""(CASE WHEN (((min(block.created_date)) < oo_1.on_time) OR (((min(block.created_date)) IS NULL) AND ((min(unblock.created_date)) IS NOT NULL))) THEN oo_1.on_time ELSE ((min(block.created_date)))::timestamp with time zone END, CASE WHEN (((min(unblock.created_date)) > oo_1.off_time) OR (((min(unblock.created_date)) IS NULL) AND ((min(block.created_date)) IS NOT NULL))) THEN oo_1.off_time ELSE ((min(unblock.created_date)))::timestamp with time zone END, oo_1.on_time, oo_1.off_time))
  • Rows Removed by Filter: 4
55. 0.000 0.000 ↑ 1.0 1 1

CTE Scan on workers_on_shift_on_off_times oo_1 (cost=0.00..0.20 rows=1 width=64) (actual time=0.000..0.000 rows=1 loops=1)

56. 0.006 0.154 ↓ 4.0 4 1

HashAggregate (cost=0.84..0.94 rows=1 width=72) (actual time=0.153..0.154 rows=4 loops=1)

  • Group Key: block.id
57. 0.001 0.148 ↓ 10.0 10 1

Nested Loop Left Join (cost=0.00..0.82 rows=1 width=72) (actual time=0.005..0.148 rows=10 loops=1)

  • Join Filter: ((unblock.created_date > block.created_date) AND (unblock.entity_id = block.entity_id))
  • Rows Removed by Join Filter: 6
58. 0.002 0.031 ↓ 4.0 4 1

Nested Loop Left Join (cost=0.00..0.51 rows=1 width=72) (actual time=0.002..0.031 rows=4 loops=1)

  • Join Filter: (wto_2.worker_id = block.entity_id)
59. 0.000 0.000 ↑ 1.0 1 1

CTE Scan on workers_turn_on wto_2 (cost=0.00..0.20 rows=1 width=48) (actual time=0.000..0.000 rows=1 loops=1)

60. 0.029 0.029 ↓ 4.0 4 1

CTE Scan on worker_state_machine_trail block (cost=0.00..0.21 rows=1 width=24) (actual time=0.001..0.029 rows=4 loops=1)

  • Filter: (((current_state)::text = 'BLOCKED'::text) AND ((previous_state)::text = 'UNBLOCKED'::text) AND ((state_machine_id)::text = 'WORKER_BLOCK_STATE_MACHINE'::text))
  • Rows Removed by Filter: 258
61. 0.116 0.116 ↓ 4.0 4 4

CTE Scan on worker_state_machine_trail unblock (cost=0.00..0.21 rows=1 width=16) (actual time=0.002..0.029 rows=4 loops=4)

  • Filter: (((current_state)::text = 'UNBLOCKED'::text) AND ((previous_state)::text = 'BLOCKED'::text) AND ((state_machine_id)::text = 'WORKER_BLOCK_STATE_MACHINE'::text))
  • Rows Removed by Filter: 258
62.          

CTE workers_on_shift_online_working_times

63. 0.005 1.437 ↓ 9.0 9 1

Nested Loop (cost=0.97..1.41 rows=1 width=64) (actual time=1.432..1.437 rows=9 loops=1)

  • Join Filter: (((wto_3.sub_region_id = oo_2.sub_region_id) OR ((wto_3.sub_region_id IS NULL) AND (oo_2.sub_region_id IS NULL))) AND ""overlaps""(COALESCE((GREATEST((max(start_work_trail.created_date))::timestamp with time zone, to_timestamp('2020-01-22 10:00:00'::text, 'YYYY-MM-DD HH24:MI:SS'::text))), oo_2.on_time), COALESCE((LEAST((min(end_work_trail.created_date))::timestamp with time zone, to_timestamp('2020-01-22 14:29:00'::text, 'YYYY-MM-DD HH24:MI:SS'::text))), oo_2.off_time), oo_2.on_time, oo_2.off_time) AND (oo_2.worker_id = wto_3.worker_id) AND (((wto_3.exclusive_origin_id = oo_2.exclusive_origin_id) AND (wto_3.origin_priority_type = oo_2.origin_priority_type)) OR ((wto_3.exclusive_origin_id IS NULL) AND (oo_2.exclusive_origin_id IS NULL))))
64. 0.000 0.000 ↑ 1.0 1 1

CTE Scan on workers_on_shift_on_off_times oo_2 (cost=0.00..0.20 rows=1 width=64) (actual time=0.000..0.000 rows=1 loops=1)

65. 0.002 1.432 ↓ 9.0 9 1

Unique (cost=0.97..0.99 rows=1 width=72) (actual time=1.430..1.432 rows=9 loops=1)

66. 0.006 1.430 ↓ 9.0 9 1

Sort (cost=0.97..0.98 rows=1 width=72) (actual time=1.430..1.430 rows=9 loops=1)

  • Sort Key: wto_3.worker_id, wto_3.exclusive_origin_id, wto_3.origin_priority_type, wto_3.sub_region_id, (GREATEST((max(start_work_trail.created_date))::timestamp with time zone, to_timestamp('2020-01-22 10:00:00'::text, 'YYYY-MM-DD HH24:MI:SS'::text))), (LEAST((min(end_work_trail.created_date))::timestamp with time zone, to_timestamp('2020-01-22 14:29:00'::text, 'YYYY-MM-DD HH24:MI:SS'::text)))
  • Sort Method: quicksort Memory: 25kB
67. 0.305 1.424 ↓ 9.0 9 1

HashAggregate (cost=0.85..0.96 rows=1 width=72) (actual time=1.393..1.424 rows=9 loops=1)

  • Group Key: start_work_trail.id, wto_3.worker_id, wto_3.exclusive_origin_id, wto_3.origin_priority_type, wto_3.sub_region_id
  • Filter: (GREATEST((max(start_work_trail.created_date))::timestamp with time zone, to_timestamp('2020-01-22 10:00:00'::text, 'YYYY-MM-DD HH24:MI:SS'::text)) < LEAST((min(end_work_trail.created_date))::timestamp with time zone, to_timestamp('2020-01-22 14:29:00'::text, 'YYYY-MM-DD HH24:MI:SS'::text)))
  • Rows Removed by Filter: 17
68. 0.172 1.119 ↓ 1,287.0 1,287 1

Nested Loop Left Join (cost=0.00..0.83 rows=1 width=72) (actual time=0.010..1.119 rows=1,287 loops=1)

  • Join Filter: ((start_work_trail.created_date < end_work_trail.created_date) AND (start_work_trail.entity_id = end_work_trail.entity_id))
  • Rows Removed by Join Filter: 325
69. 0.005 0.063 ↓ 26.0 26 1

Nested Loop (cost=0.00..0.51 rows=1 width=72) (actual time=0.006..0.063 rows=26 loops=1)

  • Join Filter: (wto_3.worker_id = start_work_trail.entity_id)
70. 0.000 0.000 ↑ 1.0 1 1

CTE Scan on workers_turn_on wto_3 (cost=0.00..0.20 rows=1 width=48) (actual time=0.000..0.000 rows=1 loops=1)

71. 0.058 0.058 ↓ 26.0 26 1

CTE Scan on worker_state_machine_trail start_work_trail (cost=0.00..0.21 rows=1 width=24) (actual time=0.005..0.058 rows=26 loops=1)

  • Filter: (((current_state)::text = 'WORKING'::text) AND ((state_machine_id)::text = 'WORKER_STATE_MACHINE'::text) AND (created_date < to_timestamp('2020-01-22 14:29:00'::text, 'YYYY-MM-DD HH24:MI:SS'::text)))
  • Rows Removed by Filter: 236
72. 0.884 0.884 ↓ 62.0 62 26

CTE Scan on worker_state_machine_trail end_work_trail (cost=0.00..0.21 rows=1 width=16) (actual time=0.003..0.034 rows=62 loops=26)

  • Filter: (((previous_state)::text = 'WORKING'::text) AND ((current_state)::text = 'FREE'::text) AND ((state_machine_id)::text = 'WORKER_STATE_MACHINE'::text))
  • Rows Removed by Filter: 200
73.          

CTE workers_on_shift_online_blocked_working_times

74. 0.000 0.000 ↓ 0.0 0 1

Nested Loop (cost=0.00..0.52 rows=1 width=64) (actual time=0.000..0.000 rows=0 loops=1)

  • Join Filter: (((t_3.sub_region_id = b.sub_region_id) OR ((t_3.sub_region_id IS NULL) AND (b.sub_region_id IS NULL))) AND ""overlaps""(t_3.start_work_time, t_3.end_work_time, b.block_time, b.unblock_time) AND (b.worker_id = t_3.worker_id) AND (((t_3.exclusive_origin_id = b.exclusive_origin_id) AND (t_3.origin_priority_type = b.origin_priority_type)) OR ((t_3.exclusive_origin_id IS NULL) AND (b.exclusive_origin_id IS NULL))))
75. 0.000 0.000 ↓ 0.0 0 1

CTE Scan on workers_on_shift_block_unblock_times b (cost=0.00..0.20 rows=1 width=64) (actual time=0.000..0.000 rows=0 loops=1)

76. 0.000 0.000 ↓ 0.0 0

CTE Scan on workers_on_shift_online_working_times t_3 (cost=0.00..0.20 rows=1 width=64) (never executed)

77. 0.001 26.340 ↑ 1.0 1 1

Nested Loop Left Join (cost=4,119.41..4,127.01 rows=1 width=281) (actual time=26.337..26.340 rows=1 loops=1)

  • Join Filter: (((t_2.sub_region_id = wto.sub_region_id) OR ((t_2.sub_region_id IS NULL) AND (wto.sub_region_id IS NULL))) AND (t_2.worker_id = w.id) AND (((t_2.exclusive_origin_id = wto.exclusive_origin_id) AND (t_2.origin_priority_type = wto.origin_priority_type)) OR ((t_2.exclusive_origin_id IS NULL) AND (wto.exclusive_origin_id IS NULL))))
78. 0.001 26.338 ↑ 1.0 1 1

Nested Loop Left Join (cost=4,119.20..4,126.48 rows=1 width=273) (actual time=26.335..26.338 rows=1 loops=1)

  • Join Filter: (((t_1.sub_region_id = wto.sub_region_id) OR ((t_1.sub_region_id IS NULL) AND (wto.sub_region_id IS NULL))) AND (t_1.worker_id = w.id) AND (((t_1.exclusive_origin_id = wto.exclusive_origin_id) AND (t_1.origin_priority_type = wto.origin_priority_type)) OR ((t_1.exclusive_origin_id IS NULL) AND (wto.exclusive_origin_id IS NULL))))
79. 0.001 24.892 ↑ 1.0 1 1

Nested Loop Left Join (cost=4,118.98..4,125.96 rows=1 width=265) (actual time=24.889..24.892 rows=1 loops=1)

  • Join Filter: (((t.sub_region_id = wto.sub_region_id) OR ((t.sub_region_id IS NULL) AND (wto.sub_region_id IS NULL))) AND (t.worker_id = w.id) AND (((t.exclusive_origin_id = wto.exclusive_origin_id) AND (t.origin_priority_type = wto.origin_priority_type)) OR ((t.exclusive_origin_id IS NULL) AND (wto.exclusive_origin_id IS NULL))))
80. 0.001 24.730 ↑ 1.0 1 1

Nested Loop Left Join (cost=4,118.76..4,125.43 rows=1 width=257) (actual time=24.727..24.730 rows=1 loops=1)

  • Join Filter: (((oo.sub_region_id = wto.sub_region_id) OR ((oo.sub_region_id IS NULL) AND (wto.sub_region_id IS NULL))) AND (oo.worker_id = w.id) AND (((oo.exclusive_origin_id = wto.exclusive_origin_id) AND (oo.origin_priority_type = wto.origin_priority_type)) OR ((oo.exclusive_origin_id IS NULL) AND (wto.exclusive_origin_id IS NULL))))
81. 0.002 24.037 ↑ 1.0 1 1

Nested Loop Left Join (cost=4,118.54..4,124.90 rows=1 width=249) (actual time=24.034..24.037 rows=1 loops=1)

  • Join Filter: (((tt_1.sub_region_id = wto.sub_region_id) OR ((tt_1.sub_region_id IS NULL) AND (wto.sub_region_id IS NULL))) AND (r_1.worker_id = w.id) AND (((tt_1.exclusive_origin_id = wto.exclusive_origin_id) AND (tt_1.origin_priority_type = wto.origin_priority_type)) OR ((tt_1.exclusive_origin_id IS NULL) AND (wto.exclusive_origin_id IS NULL))))
82. 0.004 22.572 ↑ 1.0 1 1

Nested Loop Left Join (cost=3,727.00..3,733.02 rows=1 width=201) (actual time=22.569..22.572 rows=1 loops=1)

  • Join Filter: (((tt.sub_region_id = wto.sub_region_id) OR ((tt.sub_region_id IS NULL) AND (wto.sub_region_id IS NULL))) AND (r.worker_id = w.id) AND (((tt.exclusive_origin_id = wto.exclusive_origin_id) AND (tt.origin_priority_type = wto.origin_priority_type)) OR ((tt.exclusive_origin_id IS NULL) AND (wto.exclusive_origin_id IS NULL))))
83. 0.001 0.267 ↑ 1.0 1 1

Nested Loop (cost=1.65..7.29 rows=1 width=129) (actual time=0.265..0.267 rows=1 loops=1)

84. 0.001 0.255 ↑ 1.0 1 1

Nested Loop (cost=1.22..6.74 rows=1 width=120) (actual time=0.254..0.255 rows=1 loops=1)

85. 0.001 0.245 ↓ 3.0 3 1

Nested Loop (cost=1.07..6.37 rows=1 width=128) (actual time=0.240..0.245 rows=3 loops=1)

86. 0.001 0.230 ↑ 1.0 1 1

Nested Loop (cost=0.64..4.87 rows=1 width=60) (actual time=0.229..0.230 rows=1 loops=1)

87. 0.001 0.216 ↑ 1.0 1 1

Group (cost=0.21..0.23 rows=1 width=52) (actual time=0.216..0.216 rows=1 loops=1)

  • Group Key: wto.worker_id, wto.logistics_operator_id, wto.exclusive_origin_id, wto.origin_priority_type, wto.sub_region_id
88. 0.013 0.215 ↑ 1.0 1 1

Sort (cost=0.21..0.22 rows=1 width=52) (actual time=0.215..0.215 rows=1 loops=1)

  • Sort Key: wto.worker_id, wto.logistics_operator_id, wto.exclusive_origin_id, wto.origin_priority_type, wto.sub_region_id
  • Sort Method: quicksort Memory: 25kB
89. 0.202 0.202 ↑ 1.0 1 1

CTE Scan on workers_turn_on wto (cost=0.00..0.20 rows=1 width=52) (actual time=0.200..0.202 rows=1 loops=1)

90. 0.013 0.013 ↑ 1.0 1 1

Index Scan using pk_worker on worker w (cost=0.43..4.54 rows=1 width=16) (actual time=0.013..0.013 rows=1 loops=1)

  • Index Cond: (id = wto.worker_id)
91. 0.014 0.014 ↑ 1.7 3 1

Index Scan using user_attribute_user_id_attribute_key_id_key on user_attribute ua (cost=0.43..1.00 rows=5 width=68) (actual time=0.010..0.014 rows=3 loops=1)

  • Index Cond: (user_id = w.user_id)
92. 0.009 0.009 ↓ 0.0 0 3

Index Scan using pk_attribute_key on attribute_key uak (cost=0.14..0.26 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=3)

  • Index Cond: (id = ua.attribute_key_id)
  • Filter: ((name)::text = 'CPF'::text)
  • Rows Removed by Filter: 1
93. 0.011 0.011 ↑ 1.0 1 1

Index Scan using pk_user_fleet on user_fleet u (cost=0.43..0.55 rows=1 width=33) (actual time=0.011..0.011 rows=1 loops=1)

  • Index Cond: (id = w.user_id)
94. 0.151 22.301 ↑ 1.0 1 1

GroupAggregate (cost=3,725.36..3,725.53 rows=1 width=120) (actual time=22.301..22.301 rows=1 loops=1)

  • Group Key: r.worker_id, tt.exclusive_origin_id, tt.origin_priority_type, tt.sub_region_id
95.          

Initplan (for GroupAggregate)

96. 0.007 0.007 ↑ 1.0 1 1

Index Scan using idx_attribute_key_name on attribute_key ak (cost=0.27..4.38 rows=1 width=8) (actual time=0.007..0.007 rows=1 loops=1)

  • Index Cond: ((name)::text = 'GEOFENCE_VIOLATED'::text)
97. 0.086 22.143 ↓ 261.0 261 1

Sort (cost=3,720.98..3,720.98 rows=1 width=105) (actual time=22.131..22.143 rows=261 loops=1)

  • Sort Key: r.worker_id, tt.exclusive_origin_id, tt.origin_priority_type, tt.sub_region_id
  • Sort Method: quicksort Memory: 61kB
98. 0.056 22.057 ↓ 261.0 261 1

Nested Loop Left Join (cost=439.63..3,720.97 rows=1 width=105) (actual time=21.222..22.057 rows=261 loops=1)

99. 0.069 21.677 ↓ 54.0 54 1

Nested Loop (cost=438.92..467.30 rows=1 width=87) (actual time=21.212..21.677 rows=54 loops=1)

100. 0.004 21.194 ↓ 9.0 9 1

Nested Loop (cost=438.21..440.62 rows=1 width=56) (actual time=21.177..21.194 rows=9 loops=1)

101. 0.540 0.540 ↑ 1.0 1 1

CTE Scan on turn_on_turn_off_times tt (cost=0.00..0.20 rows=1 width=64) (actual time=0.539..0.540 rows=1 loops=1)

102. 0.025 20.650 ↓ 9.0 9 1

Bitmap Heap Scan on route r (cost=438.21..440.32 rows=1 width=24) (actual time=20.635..20.650 rows=9 loops=1)

  • Recheck Cond: ((worker_id = tt.worker_id) AND (created_date >= tt.turn_on_time) AND (created_date <= tt.turn_off_time) AND (created_date >= to_timestamp('2020-01-22 10:00:00'::text, 'YYYY-MM-DD HH24:MI:SS'::text)) AND (created_date <= to_timestamp('2020-01-22 14:29:00'::text, 'YYYY-MM-DD HH24:MI:SS'::text)))
  • Heap Blocks: exact=9
103. 0.061 20.625 ↓ 0.0 0 1

BitmapAnd (cost=438.21..438.21 rows=1 width=0) (actual time=20.625..20.625 rows=0 loops=1)

104. 0.126 0.126 ↑ 1.2 865 1

Bitmap Index Scan on idx_route_worker_id (cost=0.00..24.47 rows=1,054 width=0) (actual time=0.126..0.126 rows=865 loops=1)

  • Index Cond: (worker_id = tt.worker_id)
105. 20.438 20.438 ↓ 15.5 83,529 1

Bitmap Index Scan on route_created_date_idx (cost=0.00..413.48 rows=5,394 width=0) (actual time=20.438..20.438 rows=83,529 loops=1)

  • Index Cond: ((created_date >= tt.turn_on_time) AND (created_date <= tt.turn_off_time) AND (created_date >= to_timestamp('2020-01-22 10:00:00'::text, 'YYYY-MM-DD HH24:MI:SS'::text)) AND (created_date <= to_timestamp('2020-01-22 14:29:00'::text, 'YYYY-MM-DD HH24:MI:SS'::text)))
106. 0.414 0.414 ↓ 6.0 6 9

Index Scan using idx_state_machine_event_ei_et_ei_ed on state_machine_event e (cost=0.72..26.57 rows=1 width=39) (actual time=0.011..0.046 rows=6 loops=9)

  • Index Cond: ((entity_id = r.id) AND ((entity_type)::text = 'ROUTE'::text) AND ((event_id)::text = ANY ('{CHECK_IN,CHECK_OUT,CANCEL_OFFER_TIMEOUT,REJECT,OFFER,CANCEL_OFFER,ACCEPT,AUTO_CANCEL,CANCEL}'::text[])) AND (event_date >= (to_timestamp('2020-01-22 10:00:00'::text, 'YYYY-MM-DD HH24:MI:SS'::text) - '00:03:00'::interval)) AND (event_date <= (to_timestamp('2020-01-22 14:29:00'::text, 'YYYY-MM-DD HH24:MI:SS'::text) + '01:00:00'::interval)))
  • Filter: ((event_status)::text = 'ACCEPTED'::text)
107. 0.324 0.324 ↑ 575.2 5 54

Index Scan using state_machine_event_attribute_state_machine_event_id_attrib_key on state_machine_event_attribute a (cost=0.71..2,966.07 rows=2,876 width=26) (actual time=0.005..0.006 rows=5 loops=54)

  • Index Cond: (e.id = state_machine_event_id)
108. 0.006 1.463 ↑ 1.0 1 1

GroupAggregate (cost=391.54..391.67 rows=1 width=96) (actual time=1.463..1.463 rows=1 loops=1)

  • Group Key: r_1.worker_id, tt_1.exclusive_origin_id, tt_1.origin_priority_type, tt_1.sub_region_id
109. 0.006 1.457 ↓ 9.0 9 1

Sort (cost=391.54..391.55 rows=1 width=72) (actual time=1.456..1.457 rows=9 loops=1)

  • Sort Key: tt_1.exclusive_origin_id, tt_1.origin_priority_type, tt_1.sub_region_id
  • Sort Method: quicksort Memory: 25kB
110. 0.012 1.451 ↓ 9.0 9 1

Nested Loop (cost=200.06..391.53 rows=1 width=72) (actual time=1.406..1.451 rows=9 loops=1)

  • Join Filter: ((r_1.created_date >= tt_1.turn_on_time) AND (r_1.created_date <= tt_1.turn_off_time))
  • Rows Removed by Join Filter: 6
111. 0.006 1.439 ↓ 15.0 15 1

Nested Loop (cost=200.06..391.23 rows=1 width=40) (actual time=1.369..1.439 rows=15 loops=1)

112. 0.003 1.365 ↑ 2.8 17 1

Unique (cost=199.49..199.73 rows=48 width=8) (actual time=1.360..1.365 rows=17 loops=1)

113. 0.008 1.362 ↑ 1.4 34 1

Sort (cost=199.49..199.61 rows=48 width=8) (actual time=1.360..1.362 rows=34 loops=1)

  • Sort Key: s.route_id
  • Sort Method: quicksort Memory: 26kB
114. 0.027 1.354 ↑ 1.4 34 1

Nested Loop (cost=1.14..198.15 rows=48 width=8) (actual time=0.382..1.354 rows=34 loops=1)

115. 0.009 1.225 ↑ 1.4 34 1

Nested Loop (cost=0.57..15.76 rows=48 width=8) (actual time=0.372..1.225 rows=34 loops=1)

116. 1.136 1.136 ↓ 16.0 16 1

CTE Scan on shift_orders o (cost=0.00..0.20 rows=1 width=8) (actual time=0.359..1.136 rows=16 loops=1)

117. 0.080 0.080 ↑ 24.0 2 16

Index Scan using idx_loaded_orders_order_id on loaded_orders lo (cost=0.57..10.76 rows=48 width=16) (actual time=0.005..0.005 rows=2 loops=16)

  • Index Cond: (order_id = o.id)
118. 0.102 0.102 ↑ 1.0 1 34

Index Scan using pk_service on service s (cost=0.57..3.80 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=34)

  • Index Cond: (id = lo.service_id)
119. 0.068 0.068 ↑ 1.0 1 17

Index Scan using pk_route on route r_1 (cost=0.57..3.98 rows=1 width=40) (actual time=0.004..0.004 rows=1 loops=17)

  • Index Cond: (id = s.route_id)
  • Filter: ((worker_id = 242396) AND ((route_state)::text = 'COMPLETED'::text))
  • Rows Removed by Filter: 0
120. 0.000 0.000 ↑ 1.0 1 15

CTE Scan on turn_on_turn_off_times tt_1 (cost=0.00..0.20 rows=1 width=64) (actual time=0.000..0.000 rows=1 loops=15)

  • Filter: (worker_id = 242396)
121. 0.004 0.692 ↑ 1.0 1 1

HashAggregate (cost=0.22..0.32 rows=1 width=56) (actual time=0.692..0.692 rows=1 loops=1)

  • Group Key: oo.worker_id, oo.exclusive_origin_id, oo.origin_priority_type, oo.sub_region_id
122. 0.688 0.688 ↑ 1.0 1 1

CTE Scan on workers_on_shift_on_off_times oo (cost=0.00..0.20 rows=1 width=64) (actual time=0.687..0.688 rows=1 loops=1)

123. 0.001 0.161 ↓ 0.0 0 1

HashAggregate (cost=0.22..0.32 rows=1 width=56) (actual time=0.161..0.161 rows=0 loops=1)

  • Group Key: t.worker_id, t.exclusive_origin_id, t.origin_priority_type, t.sub_region_id
124. 0.160 0.160 ↓ 0.0 0 1

CTE Scan on workers_on_shift_block_unblock_times t (cost=0.00..0.20 rows=1 width=64) (actual time=0.160..0.160 rows=0 loops=1)

125. 0.005 1.445 ↑ 1.0 1 1

HashAggregate (cost=0.22..0.32 rows=1 width=56) (actual time=1.445..1.445 rows=1 loops=1)

  • Group Key: t_1.worker_id, t_1.exclusive_origin_id, t_1.origin_priority_type, t_1.sub_region_id
126. 1.440 1.440 ↓ 9.0 9 1

CTE Scan on workers_on_shift_online_working_times t_1 (cost=0.00..0.20 rows=1 width=64) (actual time=1.433..1.440 rows=9 loops=1)

127. 0.000 0.001 ↓ 0.0 0 1

HashAggregate (cost=0.22..0.32 rows=1 width=56) (actual time=0.001..0.001 rows=0 loops=1)

  • Group Key: t_2.worker_id, t_2.exclusive_origin_id, t_2.origin_priority_type, t_2.sub_region_id
128. 0.001 0.001 ↓ 0.0 0 1

CTE Scan on workers_on_shift_online_blocked_working_times t_2 (cost=0.00..0.20 rows=1 width=64) (actual time=0.001..0.001 rows=0 loops=1)

129. 0.003 0.269 ↑ 1.0 1 1

GroupAggregate (cost=385.79..385.95 rows=1 width=56) (actual time=0.269..0.269 rows=1 loops=1)

  • Group Key: o_1.worker_id, tt_2.exclusive_origin_id, tt_2.origin_priority_type, tt_2.sub_region_id
130. 0.004 0.266 ↓ 2.5 10 1

Sort (cost=385.79..385.80 rows=4 width=48) (actual time=0.266..0.266 rows=10 loops=1)

  • Sort Key: o_1.worker_id, tt_2.exclusive_origin_id, tt_2.origin_priority_type, tt_2.sub_region_id
  • Sort Method: quicksort Memory: 25kB
131. 0.005 0.262 ↓ 2.5 10 1

Nested Loop (cost=1.71..385.75 rows=4 width=48) (actual time=0.023..0.262 rows=10 loops=1)

  • Join Filter: ((r_2.created_date >= tt_2.turn_on_time) AND (r_2.created_date <= tt_2.turn_off_time) AND (o_1.worker_id = tt_2.worker_id))
  • Rows Removed by Join Filter: 6
132. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on turn_on_turn_off_times tt_2 (cost=0.00..0.20 rows=1 width=64) (actual time=0.001..0.001 rows=1 loops=1)

133. 0.019 0.256 ↑ 2.5 16 1

Nested Loop (cost=1.71..381.25 rows=40 width=16) (actual time=0.021..0.256 rows=16 loops=1)

134. 0.016 0.203 ↑ 1.4 34 1

Nested Loop (cost=1.14..198.16 rows=48 width=16) (actual time=0.017..0.203 rows=34 loops=1)

135. 0.001 0.085 ↑ 1.4 34 1

Nested Loop (cost=0.57..15.76 rows=48 width=16) (actual time=0.009..0.085 rows=34 loops=1)

136. 0.004 0.004 ↓ 16.0 16 1

CTE Scan on shift_orders o_1 (cost=0.00..0.20 rows=1 width=16) (actual time=0.001..0.004 rows=16 loops=1)

  • Filter: ((order_state)::text = 'COMPLETED'::text)
137. 0.080 0.080 ↑ 24.0 2 16

Index Scan using idx_loaded_orders_order_id on loaded_orders lo_1 (cost=0.57..10.76 rows=48 width=16) (actual time=0.004..0.005 rows=2 loops=16)

  • Index Cond: (order_id = o_1.id)
138. 0.102 0.102 ↑ 1.0 1 34

Index Scan using pk_service on service s_1 (cost=0.57..3.80 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=34)

  • Index Cond: (id = lo_1.service_id)
139. 0.034 0.034 ↓ 0.0 0 34

Index Scan using pk_route on route r_2 (cost=0.57..3.81 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=34)

  • Index Cond: (id = s_1.route_id)
  • Filter: ((route_state)::text = 'COMPLETED'::text)
  • Rows Removed by Filter: 0
Planning time : 11.626 ms
Execution time : 27.829 ms