explain.depesz.com

PostgreSQL's explain analyze made readable

Result: LmFF

Settings
# exclusive inclusive rows x rows loops node
1. 10.267 127,203.632 ↑ 164.0 1 1

HashAggregate (cost=13,218.34..13,219.98 rows=164 width=4) (actual time=127,203.629..127,203.632 rows=1 loops=1)

  • Group Key: appts.id
2. 19.597 127,193.365 ↓ 1.7 4,758 1

Nested Loop (cost=3,600.21..13,211.34 rows=2,802 width=4) (actual time=183.528..127,193.365 rows=4,758 loops=1)

  • Join Filter: (appts.id <> appt_slot_ofrs.original_appointment_id)
3. 0.015 127,082.890 ↑ 1.0 1 1

Nested Loop Left Join (cost=55.96..6,612.15 rows=1 width=4) (actual time=133.141..127,082.890 rows=1 loops=1)

4. 3.723 127,082.866 ↑ 1.0 1 1

Hash Join (cost=55.39..6,590.95 rows=1 width=4) (actual time=133.123..127,082.866 rows=1 loops=1)

  • Hash Cond: (appts.cancellation_reason_id = cr.id)
5. 127,078.387 127,078.387 ↓ 11.0 1,796 1

Index Scan using index_appointments_on_doctor_id on appointments appts (cost=0.56..6,535.50 rows=164 width=8) (actual time=0.021..127,078.387 rows=1,796 loops=1)

  • Index Cond: (doctor_id = 48172)
  • Filter: (updated_at > (now() - '5 days'::interval))
  • Rows Removed by Filter: 19287
6. 0.276 0.756 ↓ 1.3 119 1

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

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

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

  • Filter: bump
  • Rows Removed by Filter: 2199
8. 0.009 0.009 ↓ 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.009..0.009 rows=0 loops=1)

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

Bitmap Heap Scan on appointment_slot_offers appt_slot_ofrs (cost=3,544.25..6,564.16 rows=2,802 width=4) (actual time=50.373..90.878 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.626 47.571 ↓ 0.0 0 1

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

11. 7.774 7.774 ↑ 1.1 59,816 1

Bitmap Index Scan on index_appointment_slot_offers_on_offer_type (cost=0.00..809.23 rows=63,253 width=0) (actual time=7.774..7.774 rows=59,816 loops=1)

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

Bitmap Index Scan on index_appointment_slot_offers_on_accepted_appointment_id (cost=0.00..2,733.37 rows=201,592 width=0) (actual time=37.171..37.171 rows=216,157 loops=1)

  • Index Cond: (accepted_appointment_id IS NOT NULL)
Planning time : 0.748 ms
Execution time : 127,203.714 ms