explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kDO0

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 2,923.933 ↑ 1.0 1 1

"players_driver"."operational", "players_driver"."_available", "players_driver"."transport_type", "players_driver"."marital_status", "players_driver"."gender", "players_driver"."social_name", "players_driver"."mei_name", "players_driver"."mei_im", "players_driver"."cnpj", "players_driver"."cpf", "players_driver"."municipal_inscription", "players_driver"."photo", "players_driver"."city_id", "players_driver"."regulatory_city_id", "players_driver"."attend_classic", "players_driver"."attend_retail", "players_driver"."attend_pay", "players_driver"."attend_food", "players_driver"."current_gateway", "players_driver"."chose_attend_start", "players_driver"."chose_attend_only_retail", "players_driver"."attend_pro", "players_driver"."has_grand_trunk", "players_driver"."attend_wms_pickup", "players_driver"."manual_payment_since", "players_driver"."onboard_date", "players_driver"."activation_date", "players_driver"."first_time_prime", "players_driver"."has_taken_itineraries", "players_driver"."rescinded_date", "players_driver"."rescinded_by_id", "players_driver"."rescinded_reason", "players_driver"."operational_status", "players_driver"."item_trunk_capacity", "players_driver"."item_trunk_is_lending", "players_driver"."item_trunk_ownership", "players_driver"."item_thermal_bag", "players_driver"."item_thermal_bag_ownership", "players_driver"."item_pinpad_id", "players_driver"."transfer_method", "players_driver"."first_itinerary_id", "players_driver"."modified_at" FROM "dispatch_itinerary" LEFT OUTER JOIN "dispatch_order" ON ("dispatch_itinerary"."id" = "dispatch_order"."itinerary_id") LEFT OUTER JOIN "dispatch_orderinquiry" ON ("dispatch_order"."from_inquiry_id" = "dispatch_orderinquiry"."id") LEFT OUTER JOIN "players_driver" ON ("dispatch_itinerary"."driver_id" = "players_driver"."loggiuser_ptr_id") LEFT OUTER JOIN "players_loggiuser" ON ("players_driver"."loggiuser_ptr_id" = "players_loggiuser"."id") WHERE ((("dispatch_orderinquiry"."slo" = 1 AND "dispatch_order"."product" = 1) OR ("dispatch_orderinquiry"."slo" = 2 AND "dispatch_order"."product" = 1)) AND ("dispatch_itinerary"."product_version" = 1 OR "dispatch_itinerary"."product_version" = 2) AND "dispatch_itinerary"."city_id" = 9 AND "dispatch_itinerary"."status" IN (started, accepted, awaiting_completion, requires_verification) AND "dispatch_itinerary"."created" >= 2020-03-01 00:00:00 AND "dispatch_itinerary"."created" <= 2020-03-19 23:59:59)***Nested Loop Left Join (cost=2.54..455.12 rows=1 width=1,364) (actual time=187.811..2,923.933 rows=1 loops=1)

2. 0.006 2,923.893 ↑ 1.0 1 1

Nested Loop Left Join (cost=2.11..454.07 rows=1 width=950) (actual time=187.774..2,923.893 rows=1 loops=1)

3. 0.007 2,923.189 ↑ 1.0 1 1

Nested Loop (cost=1.69..450.62 rows=1 width=673) (actual time=187.073..2,923.189 rows=1 loops=1)

4. 0.011 2,922.806 ↑ 1.0 1 1

Nested Loop (cost=1.12..448.92 rows=1 width=710) (actual time=186.690..2,922.806 rows=1 loops=1)

5. 2,922.731 2,922.731 ↑ 1.0 1 1

Index Scan using dispatch_itinerary_status on dispatch_itinerary (cost=0.56..445.33 rows=1 width=673) (actual time=186.616..2,922.731 rows=1 loops=1)

  • Index Cond: ((status)::text = ANY ('{started,accepted,awaiting_completion,requires_verification}'::text[]))
  • Filter: ((created >= '2020-03-01 00:00:00'::timestamp without time zone) AND (created <= '2020-03-19 23:59:59'::timestamp without time zone) AND (city_id = 9) AND ((product_version = 1) OR (product_version = 2)))
  • Rows Removed by Filter: 3295
6. 0.064 0.064 ↑ 1.0 1 1

Index Scan using dispatch_order_itinerary_id on dispatch_order (cost=0.56..3.58 rows=1 width=41) (actual time=0.064..0.064 rows=1 loops=1)

  • Index Cond: (itinerary_id = dispatch_itinerary.id)
  • Filter: (product = 1)
7. 0.376 0.376 ↑ 1.0 1 1

Index Scan using dispatch_orderinquiry_id_like on dispatch_orderinquiry (cost=0.56..1.69 rows=1 width=37) (actual time=0.376..0.376 rows=1 loops=1)

  • Index Cond: ((id)::text = (dispatch_order.from_inquiry_id)::text)
  • Filter: ((slo = 1) OR (slo = 2))
8. 0.698 0.698 ↑ 1.0 1 1

Index Scan using players_driver_loggiuser_ptr_id_693998cd64074fa5_uniq on players_driver (cost=0.42..3.44 rows=1 width=277) (actual time=0.698..0.698 rows=1 loops=1)

  • Index Cond: (dispatch_itinerary.driver_id = loggiuser_ptr_id)
9. 0.039 0.039 ↑ 1.0 1 1

Index Scan using players_loggiuser_pkey on players_loggiuser (cost=0.43..1.04 rows=1 width=414) (actual time=0.035..0.039 rows=1 loops=1)

  • Index Cond: (players_driver.loggiuser_ptr_id = id)