explain.depesz.com

PostgreSQL's explain analyze made readable

Result: UIHm

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.002 78,087.733 ↓ 0.0 0 1

Limit (cost=15,191.17..15,191.17 rows=1 width=852) (actual time=78,087.733..78,087.733 rows=0 loops=1)

  • Output: tasks.id, tasks.title, tasks.customer_id, tasks.user_id, tasks.created_at, tasks.updated_at, tasks.status, tasks.merchant_id, tasks.delete_at, tasks.shift_id, tasks.alerted_client_time, tasks.extras, tasks.active_way_point_id, tasks.started_time, tasks.ended_time, tasks.late, tasks.external_id, tasks.start_lat, tasks.start_lng, tasks.uuid, tasks.priority, tasks.distance_traveled, tasks.automatically_started, tasks.total_price, tasks.price_before_tax, tasks.tax_price, tasks.payment_method, tasks.tip, tasks.left_to_be_paid, tasks.origin_id, tasks.webhooks, tasks.delivery_price, tasks.accept_time, tasks.last_assigned_time, tasks.dispatcher_id, tasks.automatically_assigned, tasks.tag_id, tasks.automatically_ended, tasks.automatically_cancelled, tasks.test, tasks.late_reason, tasks.ready_to_execute, tasks.cancelled_at, tasks.first_way_point_lat, tasks.first_way_point_lng, tasks.last_way_point_lat, tasks.last_way_point_lng, tasks.first_way_point_schedule, tasks.last_way_point_schedule, tasks.discount, tasks.tip_driver_enabled, tasks.pre_delivery_tip, tasks.post_delivery_tip_cash, tasks.post_delivery_tip_credit, tasks.run_uuid, tasks.scheduled_to_be_ready, tasks.run_start_time, tasks.run_end_time, tasks.group_uuid, tasks.group_leader_id, tasks.task_type_id, tasks.parent_task_id, tasks.cancellation_lat, tasks.cancellation_lng, tasks.not_ready_to_execute_and_invisible, tasks.run_id, tasks.distance_automatically_set, tasks.done_processing, tasks.payment_type_name, tasks.linked_task_id, tasks.shadow_task_id, tasks.shadow_master_task_id, tasks.first_way_point_has_to_leave_by, tasks.acknowledged_at, tasks.task_configuration_id, tasks.fleet_id, tasks.fleet_delivery_external_id, tasks.start_preparation_at, tasks.preparation_acknowledge_time_actual, tasks.preparation_start_time_actual, tasks.preparation_start_time_planned, tasks.preparation_end_time_actual, tasks.preparation_end_time_planned, tasks.preparation_ready_for_pickup_time_actual, tasks.preparation_ready_for_pickup_time_planned, tasks.preparation_picked_up_time_actual, tasks.preparation_status, tasks.required_skills, tasks.quote_id, tasks.delivery_window_id, tasks.origin_title, tasks.last_ready_to_execute_at, tasks.round_trip, tasks.squad_leader_id, tasks.squad_uuid, tasks.failed_delivery_attempts, tasks.virtual_task, tasks.action_data, tasks.planning_done, tasks.delivery_cost
2. 0.006 78,087.731 ↓ 0.0 0 1

Sort (cost=15,191.17..15,191.17 rows=1 width=852) (actual time=78,087.731..78,087.731 rows=0 loops=1)

  • Output: tasks.id, tasks.title, tasks.customer_id, tasks.user_id, tasks.created_at, tasks.updated_at, tasks.status, tasks.merchant_id, tasks.delete_at, tasks.shift_id, tasks.alerted_client_time, tasks.extras, tasks.active_way_point_id, tasks.started_time, tasks.ended_time, tasks.late, tasks.external_id, tasks.start_lat, tasks.start_lng, tasks.uuid, tasks.priority, tasks.distance_traveled, tasks.automatically_started, tasks.total_price, tasks.price_before_tax, tasks.tax_price, tasks.payment_method, tasks.tip, tasks.left_to_be_paid, tasks.origin_id, tasks.webhooks, tasks.delivery_price, tasks.accept_time, tasks.last_assigned_time, tasks.dispatcher_id, tasks.automatically_assigned, tasks.tag_id, tasks.automatically_ended, tasks.automatically_cancelled, tasks.test, tasks.late_reason, tasks.ready_to_execute, tasks.cancelled_at, tasks.first_way_point_lat, tasks.first_way_point_lng, tasks.last_way_point_lat, tasks.last_way_point_lng, tasks.first_way_point_schedule, tasks.last_way_point_schedule, tasks.discount, tasks.tip_driver_enabled, tasks.pre_delivery_tip, tasks.post_delivery_tip_cash, tasks.post_delivery_tip_credit, tasks.run_uuid, tasks.scheduled_to_be_ready, tasks.run_start_time, tasks.run_end_time, tasks.group_uuid, tasks.group_leader_id, tasks.task_type_id, tasks.parent_task_id, tasks.cancellation_lat, tasks.cancellation_lng, tasks.not_ready_to_execute_and_invisible, tasks.run_id, tasks.distance_automatically_set, tasks.done_processing, tasks.payment_type_name, tasks.linked_task_id, tasks.shadow_task_id, tasks.shadow_master_task_id, tasks.first_way_point_has_to_leave_by, tasks.acknowledged_at, tasks.task_configuration_id, tasks.fleet_id, tasks.fleet_delivery_external_id, tasks.start_preparation_at, tasks.preparation_acknowledge_time_actual, tasks.preparation_start_time_actual, tasks.preparation_start_time_planned, tasks.preparation_end_time_actual, tasks.preparation_end_time_planned, tasks.preparation_ready_for_pickup_time_actual, tasks.preparation_ready_for_pickup_time_planned, tasks.preparation_picked_up_time_actual, tasks.preparation_status, tasks.required_skills, tasks.quote_id, tasks.delivery_window_id, tasks.origin_title, tasks.last_ready_to_execute_at, tasks.round_trip, tasks.squad_leader_id, tasks.squad_uuid, tasks.failed_delivery_attempts, tasks.virtual_task, tasks.action_data, tasks.planning_done, tasks.delivery_cost
  • Sort Key: tasks.id
  • Sort Method: quicksort Memory: 25kB
3. 0.001 78,087.725 ↓ 0.0 0 1

Nested Loop (cost=1,211.43..15,191.16 rows=1 width=852) (actual time=78,087.725..78,087.725 rows=0 loops=1)

  • Output: tasks.id, tasks.title, tasks.customer_id, tasks.user_id, tasks.created_at, tasks.updated_at, tasks.status, tasks.merchant_id, tasks.delete_at, tasks.shift_id, tasks.alerted_client_time, tasks.extras, tasks.active_way_point_id, tasks.started_time, tasks.ended_time, tasks.late, tasks.external_id, tasks.start_lat, tasks.start_lng, tasks.uuid, tasks.priority, tasks.distance_traveled, tasks.automatically_started, tasks.total_price, tasks.price_before_tax, tasks.tax_price, tasks.payment_method, tasks.tip, tasks.left_to_be_paid, tasks.origin_id, tasks.webhooks, tasks.delivery_price, tasks.accept_time, tasks.last_assigned_time, tasks.dispatcher_id, tasks.automatically_assigned, tasks.tag_id, tasks.automatically_ended, tasks.automatically_cancelled, tasks.test, tasks.late_reason, tasks.ready_to_execute, tasks.cancelled_at, tasks.first_way_point_lat, tasks.first_way_point_lng, tasks.last_way_point_lat, tasks.last_way_point_lng, tasks.first_way_point_schedule, tasks.last_way_point_schedule, tasks.discount, tasks.tip_driver_enabled, tasks.pre_delivery_tip, tasks.post_delivery_tip_cash, tasks.post_delivery_tip_credit, tasks.run_uuid, tasks.scheduled_to_be_ready, tasks.run_start_time, tasks.run_end_time, tasks.group_uuid, tasks.group_leader_id, tasks.task_type_id, tasks.parent_task_id, tasks.cancellation_lat, tasks.cancellation_lng, tasks.not_ready_to_execute_and_invisible, tasks.run_id, tasks.distance_automatically_set, tasks.done_processing, tasks.payment_type_name, tasks.linked_task_id, tasks.shadow_task_id, tasks.shadow_master_task_id, tasks.first_way_point_has_to_leave_by, tasks.acknowledged_at, tasks.task_configuration_id, tasks.fleet_id, tasks.fleet_delivery_external_id, tasks.start_preparation_at, tasks.preparation_acknowledge_time_actual, tasks.preparation_start_time_actual, tasks.preparation_start_time_planned, tasks.preparation_end_time_actual, tasks.preparation_end_time_planned, tasks.preparation_ready_for_pickup_time_actual, tasks.preparation_ready_for_pickup_time_planned, tasks.preparation_picked_up_time_actual, tasks.preparation_status, tasks.required_skills, tasks.quote_id, tasks.delivery_window_id, tasks.origin_title, tasks.last_ready_to_execute_at, tasks.round_trip, tasks.squad_leader_id, tasks.squad_uuid, tasks.failed_delivery_attempts, tasks.virtual_task, tasks.action_data, tasks.planning_done, tasks.delivery_cost
4. 3.993 78,087.724 ↓ 0.0 0 1

Nested Loop (cost=1,210.86..15,182.56 rows=1 width=856) (actual time=78,087.724..78,087.724 rows=0 loops=1)

  • Output: tasks.id, tasks.title, tasks.customer_id, tasks.user_id, tasks.created_at, tasks.updated_at, tasks.status, tasks.merchant_id, tasks.delete_at, tasks.shift_id, tasks.alerted_client_time, tasks.extras, tasks.active_way_point_id, tasks.started_time, tasks.ended_time, tasks.late, tasks.external_id, tasks.start_lat, tasks.start_lng, tasks.uuid, tasks.priority, tasks.distance_traveled, tasks.automatically_started, tasks.total_price, tasks.price_before_tax, tasks.tax_price, tasks.payment_method, tasks.tip, tasks.left_to_be_paid, tasks.origin_id, tasks.webhooks, tasks.delivery_price, tasks.accept_time, tasks.last_assigned_time, tasks.dispatcher_id, tasks.automatically_assigned, tasks.tag_id, tasks.automatically_ended, tasks.automatically_cancelled, tasks.test, tasks.late_reason, tasks.ready_to_execute, tasks.cancelled_at, tasks.first_way_point_lat, tasks.first_way_point_lng, tasks.last_way_point_lat, tasks.last_way_point_lng, tasks.first_way_point_schedule, tasks.last_way_point_schedule, tasks.discount, tasks.tip_driver_enabled, tasks.pre_delivery_tip, tasks.post_delivery_tip_cash, tasks.post_delivery_tip_credit, tasks.run_uuid, tasks.scheduled_to_be_ready, tasks.run_start_time, tasks.run_end_time, tasks.group_uuid, tasks.group_leader_id, tasks.task_type_id, tasks.parent_task_id, tasks.cancellation_lat, tasks.cancellation_lng, tasks.not_ready_to_execute_and_invisible, tasks.run_id, tasks.distance_automatically_set, tasks.done_processing, tasks.payment_type_name, tasks.linked_task_id, tasks.shadow_task_id, tasks.shadow_master_task_id, tasks.first_way_point_has_to_leave_by, tasks.acknowledged_at, tasks.task_configuration_id, tasks.fleet_id, tasks.fleet_delivery_external_id, tasks.start_preparation_at, tasks.preparation_acknowledge_time_actual, tasks.preparation_start_time_actual, tasks.preparation_start_time_planned, tasks.preparation_end_time_actual, tasks.preparation_end_time_planned, tasks.preparation_ready_for_pickup_time_actual, tasks.preparation_ready_for_pickup_time_planned, tasks.preparation_picked_up_time_actual, tasks.preparation_status, tasks.required_skills, tasks.quote_id, tasks.delivery_window_id, tasks.origin_title, tasks.last_ready_to_execute_at, tasks.round_trip, tasks.squad_leader_id, tasks.squad_uuid, tasks.failed_delivery_attempts, tasks.virtual_task, tasks.action_data, tasks.planning_done, tasks.delivery_cost, grab_mode_tasks_users.task_id
  • Join Filter: (tasks.id = grab_mode_tasks_users.task_id)
5. 42.233 113.104 ↓ 1,281.0 1,281 1

Bitmap Heap Scan on public.tasks (cost=1,210.86..1,214.88 rows=1 width=852) (actual time=72.745..113.104 rows=1,281 loops=1)

  • Output: tasks.id, tasks.title, tasks.customer_id, tasks.user_id, tasks.created_at, tasks.updated_at, tasks.status, tasks.merchant_id, tasks.delete_at, tasks.shift_id, tasks.alerted_client_time, tasks.extras, tasks.active_way_point_id, tasks.started_time, tasks.ended_time, tasks.late, tasks.external_id, tasks.start_lat, tasks.start_lng, tasks.uuid, tasks.priority, tasks.distance_traveled, tasks.automatically_started, tasks.total_price, tasks.price_before_tax, tasks.tax_price, tasks.payment_method, tasks.tip, tasks.left_to_be_paid, tasks.origin_id, tasks.webhooks, tasks.delivery_price, tasks.accept_time, tasks.last_assigned_time, tasks.dispatcher_id, tasks.automatically_assigned, tasks.tag_id, tasks.automatically_ended, tasks.automatically_cancelled, tasks.test, tasks.late_reason, tasks.ready_to_execute, tasks.cancelled_at, tasks.first_way_point_lat, tasks.first_way_point_lng, tasks.last_way_point_lat, tasks.last_way_point_lng, tasks.first_way_point_schedule, tasks.last_way_point_schedule, tasks.discount, tasks.tip_driver_enabled, tasks.pre_delivery_tip, tasks.post_delivery_tip_cash, tasks.post_delivery_tip_credit, tasks.run_uuid, tasks.scheduled_to_be_ready, tasks.run_start_time, tasks.run_end_time, tasks.group_uuid, tasks.group_leader_id, tasks.task_type_id, tasks.parent_task_id, tasks.cancellation_lat, tasks.cancellation_lng, tasks.not_ready_to_execute_and_invisible, tasks.run_id, tasks.distance_automatically_set, tasks.done_processing, tasks.payment_type_name, tasks.linked_task_id, tasks.shadow_task_id, tasks.shadow_master_task_id, tasks.first_way_point_has_to_leave_by, tasks.acknowledged_at, tasks.task_configuration_id, tasks.fleet_id, tasks.fleet_delivery_external_id, tasks.start_preparation_at, tasks.preparation_acknowledge_time_actual, tasks.preparation_start_time_actual, tasks.preparation_start_time_planned, tasks.preparation_end_time_actual, tasks.preparation_end_time_planned, tasks.preparation_ready_for_pickup_time_actual, tasks.preparation_ready_for_pickup_time_planned, tasks.preparation_picked_up_time_actual, tasks.preparation_status, tasks.required_skills, tasks.quote_id, tasks.delivery_window_id, tasks.origin_title, tasks.last_ready_to_execute_at, tasks.round_trip, tasks.squad_leader_id, tasks.squad_uuid, tasks.failed_delivery_attempts, tasks.virtual_task, tasks.action_data, tasks.planning_done, tasks.delivery_cost
  • Recheck Cond: ((tasks.merchant_id = 11377) AND (tasks.user_id IS NULL) AND (tasks.delete_at IS NULL) AND (tasks.status = 0))
  • Rows Removed by Index Recheck: 10051
  • Filter: (tasks.group_leader_id IS NULL)
  • Heap Blocks: exact=10718
6. 6.393 70.871 ↓ 0.0 0 1

BitmapAnd (cost=1,210.86..1,210.86 rows=1 width=0) (actual time=70.871..70.871 rows=0 loops=1)

7. 10.272 10.272 ↓ 138.8 53,855 1

Bitmap Index Scan on index_tasks_on_merchant_id_and_user_id (cost=0.00..25.41 rows=388 width=0) (actual time=10.272..10.272 rows=53,855 loops=1)

  • Index Cond: ((tasks.merchant_id = 11377) AND (tasks.user_id IS NULL) AND (tasks.user_id IS NULL))
8. 54.206 54.206 ↓ 11.4 210,432 1

Bitmap Index Scan on index_tasks_with_runs (cost=0.00..1,185.20 rows=18,464 width=0) (actual time=54.206..54.206 rows=210,432 loops=1)

  • Index Cond: ((tasks.delete_at IS NULL) AND (tasks.status = 0))
9. 77,970.627 77,970.627 ↓ 0.0 0 1,281

Seq Scan on public.grab_mode_tasks_users (cost=0.00..13,963.49 rows=336 width=4) (actual time=60.867..60.867 rows=0 loops=1,281)

  • Output: grab_mode_tasks_users.id, grab_mode_tasks_users.task_id, grab_mode_tasks_users.user_id, grab_mode_tasks_users.created_at, grab_mode_tasks_users.updated_at, grab_mode_tasks_users.delete_at
  • Filter: (grab_mode_tasks_users.user_id = 826931)
  • Rows Removed by Filter: 629343
10. 0.000 0.000 ↓ 0.0 0

Index Scan using index_tasks_teams_on_task_id on public.tasks_teams (cost=0.56..8.58 rows=1 width=4) (never executed)

  • Output: tasks_teams.task_id, tasks_teams.team_id
  • Index Cond: (tasks_teams.task_id = tasks.id)
  • Filter: (tasks_teams.team_id = 18739)
Planning time : 0.714 ms
Execution time : 78,088.257 ms