explain.depesz.com

PostgreSQL's explain analyze made readable

Result: SdkY

Settings
# exclusive inclusive rows x rows loops node
1. 218.046 22,296.162 ↓ 116,360.0 116,360 1

Sort (cost=104,657.02..104,657.03 rows=1 width=270) (actual time=22,249.062..22,296.162 rows=116,360 loops=1)

  • Sort Key: r.external_leg_id
  • Sort Method: external merge Disk: 30,136kB
2. 304.215 22,078.116 ↓ 116,360.0 116,360 1

Nested Loop (cost=1,001.28..104,657.01 rows=1 width=270) (actual time=17.384..22,078.116 rows=116,360 loops=1)

  • Join Filter: ((vl.ride_id = vld.ride_id) AND (vl.id = vld.vendor_list_id))
  • Rows Removed by Join Filter: 115,252
3. 0.000 1,031.601 ↓ 7,282.0 43,692 1

Gather (cost=1,000.85..103,913.81 rows=6 width=173) (actual time=14.152..1,031.601 rows=43,692 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
4. 19.090 2,049.584 ↓ 7,282.0 14,564 3 / 3

Nested Loop (cost=0.85..102,913.21 rows=2 width=173) (actual time=38.025..2,049.584 rows=14,564 loops=3)

5. 12.246 1,841.023 ↓ 910.9 14,575 3 / 3

Nested Loop (cost=0.43..102,837.34 rows=16 width=161) (actual time=38.004..1,841.023 rows=14,575 loops=3)

6. 1,568.937 1,568.937 ↓ 5.7 12,373 3 / 3

Parallel Seq Scan on appointments ap (cost=0.00..74,544.89 rows=2,165 width=73) (actual time=37.972..1,568.937 rows=12,373 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,721
7. 259.840 259.840 ↑ 1.0 1 37,120 / 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.016..0.021 rows=1 loops=37,120)

  • 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
8. 189.471 189.471 ↑ 1.0 1 43,724 / 3

Index Scan using vendor_lists_ride_id on vendor_lists vl (cost=0.42..4.73 rows=1 width=12) (actual time=0.008..0.013 rows=1 loops=43,724)

  • Index Cond: (ride_id = r.id)
  • Filter: ((status)::text = 'active'::text)
  • Rows Removed by Filter: 1
9. 12,015.300 12,015.300 ↑ 7.2 5 43,692

Index Scan using vendor_list_details_ride_id on vendor_list_details vld (cost=0.43..108.24 rows=36 width=101) (actual time=0.094..0.275 rows=5 loops=43,692)

  • 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
10.          

SubPlan (for Nested Loop)

11. 930.880 8,727.000 ↑ 1.0 1 116,360

Aggregate (cost=90.48..90.49 rows=1 width=8) (actual time=0.075..0.075 rows=1 loops=116,360)

12. 7,796.120 7,796.120 ↑ 9.5 32 116,360

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.019..0.067 rows=32 loops=116,360)

  • 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 : 17.962 ms
Execution time : 22,322.847 ms