explain.depesz.com

PostgreSQL's explain analyze made readable

Result: eqR2

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 70,621.448 ↓ 0.0 0 1

Limit (cost=36,683.42..36,683.42 rows=1 width=8) (actual time=70,621.448..70,621.448 rows=0 loops=1)

  • Output: ma.registration_dt
  • Buffers: shared hit=1219 read=1361
  • I/O Timings: read=70577.309
2. 0.040 70,621.446 ↓ 0.0 0 1

Sort (cost=36,683.42..36,683.42 rows=1 width=8) (actual time=70,621.446..70,621.446 rows=0 loops=1)

  • Output: ma.registration_dt
  • Sort Key: ma.registration_dt
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=1219 read=1361
  • I/O Timings: read=70577.309
3. 0.001 70,621.406 ↓ 0.0 0 1

Nested Loop Left Join (cost=34,182.64..36,683.41 rows=1 width=8) (actual time=70,621.406..70,621.406 rows=0 loops=1)

  • Output: ma.registration_dt
  • Filter: CASE WHEN (ssr.is_rendered AND NULL::boolean) THEN false ELSE true END
  • Buffers: shared hit=1216 read=1361
  • I/O Timings: read=70577.309
4. 0.000 70,621.405 ↓ 0.0 0 1

Nested Loop (cost=34,182.07..36,676.35 rows=1 width=12) (actual time=70,621.405..70,621.405 rows=0 loops=1)

  • Output: ma.registration_dt, ma.srv_rendered_id
  • Buffers: shared hit=1216 read=1361
  • I/O Timings: read=70577.309
5. 0.001 70,621.405 ↓ 0.0 0 1

Nested Loop (cost=34,181.50..36,667.76 rows=1 width=16) (actual time=70,621.405..70,621.405 rows=0 loops=1)

  • Output: ma.registration_dt, ma.srv_rendered_id, strg.res_group_id
  • Buffers: shared hit=1216 read=1361
  • I/O Timings: read=70577.309
6. 0.021 70,621.404 ↓ 0.0 0 1

Hash Right Join (cost=34,181.06..36,663.58 rows=1 width=24) (actual time=70,621.404..70,621.404 rows=0 loops=1)

  • Output: sst.ticket_id, ma.registration_dt, ma.id, ma.srv_rendered_id, strg.res_group_id
  • Hash Cond: (mha.appointment_id = ma.id)
  • Buffers: shared hit=1216 read=1361
  • I/O Timings: read=70577.309
7. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.md_hcall_assignment mha (cost=0.00..2,154.55 rows=87,455 width=8) (never executed)

  • Output: mha.id, mha.house_call_id, mha.appointment_id, mha.date, mha.reassign_reason_id, mha.comment, mha.aud_who, mha.aud_when, mha.aud_source, mha.aud_who_create, mha.aud_when_create, mha.aud_source_create, mha.department_id
8. 0.001 70,621.383 ↓ 0.0 0 1

Hash (cost=34,181.05..34,181.05 rows=1 width=24) (actual time=70,621.383..70,621.383 rows=0 loops=1)

  • Output: sst.ticket_id, ma.registration_dt, ma.id, ma.srv_rendered_id, strg.res_group_id
  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
  • Buffers: shared hit=1213 read=1361
  • I/O Timings: read=70577.309
9. 0.002 70,621.382 ↓ 0.0 0 1

Nested Loop (cost=2.42..34,181.05 rows=1 width=24) (actual time=70,621.382..70,621.382 rows=0 loops=1)

  • Output: sst.ticket_id, ma.registration_dt, ma.id, ma.srv_rendered_id, strg.res_group_id
  • Join Filter: (((COALESCE(ss.bdatetime, ma.bdatetime))::date >= '2020-01-31'::date) AND ((COALESCE(ss.bdatetime, ma.bdatetime))::date <= '2020-01-31'::date))
  • Buffers: shared hit=1213 read=1361
  • I/O Timings: read=70577.309
10. 0.001 70,621.380 ↓ 0.0 0 1

Nested Loop (cost=1.85..34,089.74 rows=13 width=16) (actual time=70,621.380..70,621.380 rows=0 loops=1)

  • Output: ss.bdatetime, sst.ticket_id, strg.res_group_id
  • Buffers: shared hit=1213 read=1361
  • I/O Timings: read=70577.309
11. 1.940 70,621.379 ↓ 0.0 0 1

Nested Loop (cost=1.42..34,001.94 rows=20 width=16) (actual time=70,621.379..70,621.379 rows=0 loops=1)

  • Output: ss.id, ss.bdatetime, strg.res_group_id
  • Buffers: shared hit=1213 read=1361
  • I/O Timings: read=70577.309
12. 1.010 6,052.334 ↑ 1.7 271 1

Nested Loop (cost=0.85..507.64 rows=462 width=8) (actual time=213.105..6,052.334 rows=271 loops=1)

  • Output: ss1.id, strg.res_group_id
  • Buffers: shared hit=40 read=144
  • I/O Timings: read=6047.584
13. 827.724 827.724 ↑ 1.7 15 1

Index Scan using idx_sr_timetable_res_group on public.sr_timetable_res_group strg (cost=0.42..75.39 rows=26 width=8) (actual time=43.883..827.724 rows=15 loops=1)

  • Output: strg.id, strg.res_group_id, strg.aud_who, strg.aud_when, strg.aud_source, strg.aud_who_create, strg.aud_when_create, strg.aud_source_create
  • Index Cond: (strg.res_group_id = 58580925)
  • Buffers: shared hit=2 read=14
  • I/O Timings: read=827.429
14. 5,223.600 5,223.600 ↑ 1.3 18 15

Index Scan using sr_shift_timetable_id_idx on public.sr_shift ss1 (cost=0.43..16.38 rows=24 width=8) (actual time=92.816..348.240 rows=18 loops=15)

  • Output: ss1.id, ss1.bdatetime, ss1.edatetime, ss1.schedule_id, ss1.time_type_id, ss1.timetable_id, ss1.schedule_kind_id, ss1.aud_who, ss1.aud_when, ss1.aud_source, ss1.aud_who_create, ss1.aud_when_create, ss1.aud_source_create
  • Index Cond: (ss1.timetable_id = strg.id)
  • Buffers: shared hit=38 read=130
  • I/O Timings: read=5220.155
15. 64,567.105 64,567.105 ↓ 0.0 0 271

Index Scan using sr_session_shift_id_idx on public.sr_session ss (cost=0.56..72.49 rows=1 width=16) (actual time=238.255..238.255 rows=0 loops=271)

  • Output: ss.id, ss.bdatetime, ss.edatetime, ss.time_type_id, ss.shift_id, ss.is_house_call, ss.aud_who, ss.aud_when, ss.aud_source, ss.aud_who_create, ss.aud_when_create, ss.aud_source_create, ss.eboard_prohibited, ss.session_number, ss.ticket_counter
  • Index Cond: (ss.shift_id = ss1.id)
  • Filter: ss.is_house_call
  • Rows Removed by Filter: 18
  • Buffers: shared hit=1173 read=1217
  • I/O Timings: read=64529.725
16. 0.000 0.000 ↓ 0.0 0

Index Only Scan using sr_session_ticket_pk on public.sr_session_ticket sst (cost=0.44..4.37 rows=2 width=8) (never executed)

  • Output: sst.session_id, sst.ticket_id
  • Index Cond: (sst.session_id = ss.id)
  • Heap Fetches: 0
17. 0.000 0.000 ↓ 0.0 0

Index Scan using md_appointment_pk on public.md_appointment ma (cost=0.56..7.00 rows=1 width=28) (never executed)

  • Output: ma.id, ma.srv_rendered_id, ma.executor_id, ma.bdatetime, ma.customer_id, ma.funding_id, ma.state_id, ma.service_id, ma.cancel_reason_id, ma.care_regimen_id, ma.care_level_id, ma.referral_id, ma.source_id, ma.registrator_id, ma.registration_dt, ma.edatetime, ma.is_urgent, ma.notif_contact, ma.price_list_id, ma.message, ma.queue_state_id, ma.queue_change_dt, ma.ticket_number, ma.price, ma.init_goal_id, ma.organization_id, ma.is_house_call, ma.comment, ma.aud_who, ma.aud_when, ma.aud_source, ma.aud_who_create, ma.aud_when_create, ma.aud_source_create, ma.reject_comment, ma.reject_reason_id, ma.way_id, ma.is_cito, ma.event_id, ma.is_send_message, ma.comment_send_message, ma.cancel_dt, ma.answer_portal_code
  • Index Cond: (ma.id = sst.ticket_id)
18. 0.000 0.000 ↓ 0.0 0

Index Only Scan using sr_ticket_pk on public.sr_ticket st (cost=0.44..4.17 rows=1 width=4) (never executed)

  • Output: st.id
  • Index Cond: (st.id = sst.ticket_id)
  • Heap Fetches: 0
19. 0.000 0.000 ↓ 0.0 0

Index Only Scan using sr_res_group_responsible_id_id_ix on public.sr_res_group srg (cost=0.57..8.59 rows=1 width=4) (never executed)

  • Output: srg.responsible_id, srg.id
  • Index Cond: ((srg.responsible_id = 73230) AND (srg.id = 58580925))
  • Heap Fetches: 0
20. 0.000 0.000 ↓ 0.0 0

Index Scan using sr_srv_rendered_pk on public.sr_srv_rendered ssr (cost=0.57..7.04 rows=1 width=5) (never executed)

  • Output: ssr.id, ssr.bdate, ssr.comment, ssr.cost, ssr.duration, ssr.edate, ssr.is_rendered, ssr.quantity, ssr.total_cost, ssr.contract_id, ssr.customer_id, ssr.funding_id, ssr.res_group_id, ssr.service_id, ssr.duration_measure_unit_id, ssr.begin_time, ssr.prototype_id, ssr.org_id, ssr.price_list_id, ssr.cul, ssr.parent_id, ssr.payment_status_id, ssr.root_service_id, ssr.is_wholly_rendered, ssr.planned_date, ssr.planned_time, ssr.tooth_number, ssr.is_refused, ssr.aud_who, ssr.aud_when, ssr.aud_source, ssr.aud_who_create, ssr.aud_when_create, ssr.aud_source_create, ssr.is_amalgam_filling, ssr.is_mobile_medical_teams, ssr.close_date, ssr.complex_srv_id, ssr.for_upload, ssr.uid, ssr.is_need_consulting
  • Index Cond: (ma.srv_rendered_id = ssr.id)
Planning time : 19.861 ms
Execution time : 70,621.816 ms