explain.depesz.com

PostgreSQL's explain analyze made readable

Result: lmqT

Settings
# exclusive inclusive rows x rows loops node
1. 10.135 35,190.687 ↑ 163.0 1 1

HashAggregate (cost=13,250.45..13,252.08 rows=163 width=4) (actual time=35,190.684..35,190.687 rows=1 loops=1)

  • Group Key: appts.id
2. 19.552 35,180.552 ↓ 1.7 4,758 1

Nested Loop (cost=3,601.39..13,243.44 rows=2,802 width=4) (actual time=4,746.087..35,180.552 rows=4,758 loops=1)

  • Join Filter: (appts.id <> appt_slot_ofrs.original_appointment_id)
3. 0.016 35,066.292 ↑ 1.0 1 1

Nested Loop Left Join (cost=55.96..6,643.08 rows=1 width=4) (actual time=4,691.228..35,066.292 rows=1 loops=1)

4. 4.320 35,066.250 ↑ 1.0 1 1

Hash Join (cost=55.39..6,621.88 rows=1 width=4) (actual time=4,691.191..35,066.250 rows=1 loops=1)

  • Hash Cond: (appts.cancellation_reason_id = cr.id)
5. 35,061.009 35,061.009 ↓ 11.1 1,815 1

Index Scan using index_appointments_on_doctor_id on appointments appts (cost=0.56..6,566.43 rows=163 width=8) (actual time=16.253..35,061.009 rows=1,815 loops=1)

  • Index Cond: (doctor_id = 48172)
  • Filter: ((updated_at <= now()) AND (updated_at >= (now() - '5 days'::interval)))
  • Rows Removed by Filter: 19268
6. 0.304 0.921 ↓ 1.3 119 1

Hash (cost=53.64..53.64 rows=95 width=4) (actual time=0.921..0.921 rows=119 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
7. 0.617 0.617 ↓ 1.3 119 1

Seq Scan on cancellation_reasons cr (cost=0.00..53.64 rows=95 width=4) (actual time=0.015..0.617 rows=119 loops=1)

  • Filter: bump
  • Rows Removed by Filter: 2199
8. 0.026 0.026 ↓ 0.0 0 1

Index Only Scan using index_appointments_on_rescheduled_from_id on appointments rescheduled_to (cost=0.56..20.70 rows=50 width=4) (actual time=0.026..0.026 rows=0 loops=1)

  • Index Cond: (rescheduled_from_id = appts.id)
  • Heap Fetches: 0
9. 42.398 94.708 ↓ 1.7 4,758 1

Bitmap Heap Scan on appointment_slot_offers appt_slot_ofrs (cost=3,545.43..6,565.34 rows=2,802 width=4) (actual time=54.847..94.708 rows=4,758 loops=1)

  • Recheck Cond: (((offer_type)::text = 'bump'::text) AND (accepted_appointment_id IS NOT NULL))
  • Rows Removed by Index Recheck: 38142
  • Heap Blocks: exact=14399
10. 2.451 52.310 ↓ 0.0 0 1

BitmapAnd (cost=3,545.43..3,545.43 rows=2,802 width=0) (actual time=52.310..52.310 rows=0 loops=1)

11. 8.310 8.310 ↑ 1.1 59,830 1

Bitmap Index Scan on index_appointment_slot_offers_on_offer_type (cost=0.00..810.35 rows=63,256 width=0) (actual time=8.310..8.310 rows=59,830 loops=1)

  • Index Cond: ((offer_type)::text = 'bump'::text)
12. 41.549 41.549 ↓ 1.1 216,180 1

Bitmap Index Scan on index_appointment_slot_offers_on_accepted_appointment_id (cost=0.00..2,733.42 rows=201,599 width=0) (actual time=41.549..41.549 rows=216,180 loops=1)

  • Index Cond: (accepted_appointment_id IS NOT NULL)
Planning time : 104.780 ms
Execution time : 35,190.810 ms