explain.depesz.com

PostgreSQL's explain analyze made readable

Result: yXHq

Settings
# exclusive inclusive rows x rows loops node
1. 275.767 6,021.369 ↓ 114,577.0 114,577 1

Nested Loop (cost=1,001.28..104,547.59 rows=1 width=270) (actual time=8.393..6,021.369 rows=114,577 loops=1)

  • Join Filter: ((vl.ride_id = vld.ride_id) AND (vl.id = vld.vendor_list_id))
  • Rows Removed by Join Filter: 116,762
2. 0.000 106.241 ↓ 8,706.6 43,533 1

Gather (cost=1,000.85..103,909.84 rows=5 width=173) (actual time=8.310..106.241 rows=43,533 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 23.970 383.316 ↓ 7,255.5 14,511 3 / 3

Nested Loop (cost=0.85..102,909.34 rows=2 width=173) (actual time=2.744..383.316 rows=14,511 loops=3)

4. 19.504 315.781 ↓ 968.1 14,522 3 / 3

Nested Loop (cost=0.43..102,837.34 rows=15 width=161) (actual time=2.728..315.781 rows=14,522 loops=3)

5. 198.293 198.293 ↓ 5.7 12,248 3 / 3

Parallel Seq Scan on appointments ap (cost=0.00..74,544.89 rows=2,165 width=73) (actual time=2.705..198.293 rows=12,248 loops=3)

  • Filter: ((external_order_id IS NOT NULL) AND ((appointment_status)::text <> ALL ('{"Appointment Completed","Appointment Canceled","Patient No Show"}'::text[])))
  • Rows Removed by Filter: 331,847
6. 97.984 97.984 ↑ 1.0 1 36,744 / 3

Index Scan using idx_appt_id_ride_detail on ride_details r (cost=0.43..13.06 rows=1 width=92) (actual time=0.006..0.008 rows=1 loops=36,744)

  • Index Cond: (appt_id = ap.id)
  • Filter: ((provider_id <> ALL ('{1,2}'::integer[])) AND (flags = 0) AND ((ride_category)::text <> ALL ('{completed,active,issue,retro_queued}'::text[])))
  • Rows Removed by Filter: 1
7. 43.565 43.565 ↑ 1.0 1 43,565 / 3

Index Scan using vendor_lists_ride_id on vendor_lists vl (cost=0.42..4.79 rows=1 width=12) (actual time=0.003..0.003 rows=1 loops=43,565)

  • Index Cond: (ride_id = r.id)
  • Filter: ((status)::text = 'active'::text)
  • Rows Removed by Filter: 1
8. 827.127 827.127 ↑ 7.2 5 43,533

Index Scan using vendor_list_details_ride_id on vendor_list_details vld (cost=0.43..108.91 rows=36 width=101) (actual time=0.006..0.019 rows=5 loops=43,533)

  • Index Cond: (ride_id = r.id)
  • Filter: ((status)::text = ANY ('{4,0,3,7,8,9,10,6,5}'::text[]))
  • Rows Removed by Filter: 46
9.          

SubPlan (for Nested Loop)

10. 916.616 4,812.234 ↑ 1.0 1 114,577

Aggregate (cost=90.48..90.49 rows=1 width=8) (actual time=0.042..0.042 rows=1 loops=114,577)

11. 3,895.618 3,895.618 ↑ 9.2 33 114,577

Index Scan using vendor_list_details_vendor_list_id on vendor_list_details (cost=0.43..89.73 rows=303 width=4) (actual time=0.012..0.034 rows=33 loops=114,577)

  • Index Cond: (vendor_list_id = vld.vendor_list_id)
  • Filter: ((status IS NULL) AND (ride_id IS NOT NULL) AND (vendor_type = 4))
  • Rows Removed by Filter: 24
Planning time : 3.705 ms
Execution time : 6,046.367 ms