explain.depesz.com

PostgreSQL's explain analyze made readable

Result: KgHt : test

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Limit (cost=70,997.01..70,997.03 rows=7 width=527) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=70,997.01..70,997.03 rows=7 width=527) (actual rows= loops=)

  • Sort Key: ride.appt_date_time
3. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=34,347.63..70,996.92 rows=7 width=527) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=34,331.83..70,871.10 rows=7 width=520) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=34,331.40..70,811.99 rows=7 width=465) (actual rows= loops=)

  • Join Filter: (appointment.recurrence_id = recurrence_rides.id)
6. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=34,331.40..70,712.67 rows=7 width=463) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Nested Loop (cost=34,330.98..70,670.18 rows=7 width=455) (actual rows= loops=)

  • Join Filter: (appointment.org_id = org.id)
8. 0.000 0.000 ↓ 0.0

Index Scan using idx_main_contact_id on organisations org (cost=0.28..574.98 rows=1,007 width=77) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Materialize (cost=34,330.71..69,989.49 rows=7 width=386) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Nested Loop (cost=34,330.71..69,989.45 rows=7 width=386) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Nested Loop (cost=34,330.29..69,930.96 rows=7 width=359) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Nested Loop (cost=34,329.87..69,926.83 rows=7 width=332) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on ride_details ride (cost=34,329.44..69,512.23 rows=49 width=248) (actual rows= loops=)

  • Recheck Cond: (((ride_status)::text = ANY ('{Confirmed,"Failed Fuse","Potential Unavailability","Pending Approval","Offer Created",UATP,NEPF,"Potential Unavailability","Pending Approval",NDA,"No Driver Assigned","Order Updated",Offered,"Pending - Re-Offer","24 Hour Confirmation Missing","Validation Failed","Offered NDA"}'::text[])) AND (org_id = ANY ('{1604,1605,1606,1721,1742,1743,1755,1756,1757,1810,1811,1813,1816,1825,1885}'::integer[])))
  • Filter: ((NOT is_pr_ride) AND (NULLIF(leg_no, 1) IS NULL))
14. 0.000 0.000 ↓ 0.0

BitmapAnd (cost=34,329.44..34,329.44 rows=9,737 width=0) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on ride_status (cost=0.00..2,880.18 rows=61,457 width=0) (actual rows= loops=)

  • Index Cond: ((ride_status)::text = ANY ('{Confirmed,"Failed Fuse","Potential Unavailability","Pending Approval","Offer Created",UATP,NEPF,"Potential Unavailability","Pending Approval",NDA,"No Driver Assigned","Order Updated",Offered,"Pending - Re-Offer","24 Hour Confirmation Missing","Validation Failed","Offered NDA"}'::text[]))
16. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on idx_ride_organisationid (cost=0.00..31,448.99 rows=314,758 width=0) (actual rows= loops=)

  • Index Cond: (org_id = ANY ('{1604,1605,1606,1721,1742,1743,1755,1756,1757,1810,1811,1813,1816,1825,1885}'::integer[]))
17. 0.000 0.000 ↓ 0.0

Index Scan using appointments_pkey on appointments appointment (cost=0.42..8.46 rows=1 width=84) (actual rows= loops=)

  • Index Cond: (id = ride.appt_id)
  • Filter: (org_id = ANY ('{1604,1605,1606,1721,1742,1743,1755,1756,1757,1810,1811,1813,1816,1825,1885}'::integer[]))
18. 0.000 0.000 ↓ 0.0

Index Scan using patients_pkey on patients appt_patient (cost=0.42..0.59 rows=1 width=31) (actual rows= loops=)

  • Index Cond: (id = appointment.patient_id)
19. 0.000 0.000 ↓ 0.0

Index Scan using patients_pkey on patients patient (cost=0.42..8.36 rows=1 width=31) (actual rows= loops=)

  • Index Cond: (id = ride.patient_id)
20. 0.000 0.000 ↓ 0.0

Index Scan using users_pkey on users main_contact (cost=0.42..6.07 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (id = org.main_contact_id)
21. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..31.87 rows=658 width=6) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Seq Scan on recurrence_rides (cost=0.00..28.58 rows=658 width=6) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Index Scan using ride_detail_id_unique on ride_additional_details (cost=0.43..8.45 rows=1 width=59) (actual rows= loops=)

  • Index Cond: (ride.id = ride_detail_id)
24. 0.000 0.000 ↓ 0.0

Index Scan using idx_phone_number_zip_zip_code on phone_number_zip (cost=15.80..17.95 rows=1 width=23) (actual rows= loops=)

  • Index Cond: ((zip_code)::text = (SubPlan 2))
  • Filter: (org_id = ride.org_id)
25.          

SubPlan (for Index Scan)

26. 0.000 0.000 ↓ 0.0

Limit (cost=7.51..15.53 rows=1 width=32) (actual rows= loops=)

27.          

Initplan (for Limit)

28. 0.000 0.000 ↓ 0.0

Limit (cost=0.43..7.08 rows=1 width=4) (actual rows= loops=)

29. 0.000 0.000 ↓ 0.0

Index Scan using idx_appt_id_ride_detail on ride_details riden (cost=0.43..13.73 rows=2 width=4) (actual rows= loops=)

  • Index Cond: (ride.appt_id = appt_id)
  • Filter: (leg_no = 1)
30. 0.000 0.000 ↓ 0.0

Index Scan using ride_detail_id_unique on ride_additional_details ride_additional_details_1 (cost=0.43..8.45 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (ride_detail_id = $1)