explain.depesz.com

PostgreSQL's explain analyze made readable

Result: aslO

Settings
# exclusive inclusive rows x rows loops node
1. 8.850 788.411 ↓ 0.0 0 1

Nested Loop (cost=1.71..1,206.28 rows=33 width=941) (actual time=788.411..788.411 rows=0 loops=1)

  • Output: s.id, s.bdatetime, s.edatetime, s.schedule_id, s.time_type_id, s.timetable_id, s.schedule_kind_id, s.aud_who, s.aud_when, s.aud_source, s.aud_who_create, s.aud_when_create, s.aud_source_create, rg.id, rg.res_group_id, rg.aud_who, rg.aud_when, rg.aud_source, rg.aud_who_create, rg.aud_when_create, rg.aud_source_create, tt.id, tt.bdate, tt.edate, tt.aud_who, tt.aud_when, tt.aud_source, tt.aud_who_create, tt.aud_when_create, tt.aud_source_create, a.id, a.srv_rendered_id, a.executor_id, a.bdatetime, a.customer_id, a.funding_id, a.state_id, a.service_id, a.cancel_reason_id, a.care_regimen_id, a.care_level_id, a.referral_id, a.source_id, a.registrator_id, a.registration_dt, a.edatetime, a.is_urgent, a.notif_contact, a.price_list_id, a.message, a.queue_state_id, a.queue_change_dt, a.ticket_number, a.price, a.init_goal_id, a.organization_id, a.is_house_call, a.comment, a.aud_who, a.aud_when, a.aud_source, a.aud_who_create, a.aud_when_create, a.aud_source_create, a.reject_comment, a.reject_reason_id, a.way_id, a.is_cito, a.event_id, a.is_send_message, a.comment_send_message, a.cancel_dt, a.answer_portal_code
  • Join Filter: ((s.bdatetime <= a.bdatetime) AND (a.bdatetime < s.edatetime))
  • Rows Removed by Join Filter: 45825
  • Buffers: shared hit=179314
2. 0.032 0.426 ↑ 1.0 5 1

Nested Loop (cost=1.27..76.12 rows=5 width=212) (actual time=0.105..0.426 rows=5 loops=1)

  • Output: s.id, s.bdatetime, s.edatetime, s.schedule_id, s.time_type_id, s.timetable_id, s.schedule_kind_id, s.aud_who, s.aud_when, s.aud_source, s.aud_who_create, s.aud_when_create, s.aud_source_create, rg.id, rg.res_group_id, rg.aud_who, rg.aud_when, rg.aud_source, rg.aud_who_create, rg.aud_when_create, rg.aud_source_create, tt.id, tt.bdate, tt.edate, tt.aud_who, tt.aud_when, tt.aud_source, tt.aud_who_create, tt.aud_when_create, tt.aud_source_create
  • Join Filter: (s.timetable_id = rg.id)
  • Buffers: shared hit=59
3. 0.033 0.279 ↑ 1.0 5 1

Nested Loop (cost=0.85..73.64 rows=5 width=152) (actual time=0.064..0.279 rows=5 loops=1)

  • Output: s.id, s.bdatetime, s.edatetime, s.schedule_id, s.time_type_id, s.timetable_id, s.schedule_kind_id, s.aud_who, s.aud_when, s.aud_source, s.aud_who_create, s.aud_when_create, s.aud_source_create, tt.id, tt.bdate, tt.edate, tt.aud_who, tt.aud_when, tt.aud_source, tt.aud_who_create, tt.aud_when_create, tt.aud_source_create
  • Buffers: shared hit=39
4. 0.151 0.151 ↑ 1.0 5 1

Index Scan using sr_shift_pk on public.sr_shift s (cost=0.43..31.39 rows=5 width=88) (actual time=0.027..0.151 rows=5 loops=1)

  • Output: s.id, s.bdatetime, s.edatetime, s.schedule_id, s.time_type_id, s.timetable_id, s.schedule_kind_id, s.aud_who, s.aud_when, s.aud_source, s.aud_who_create, s.aud_when_create, s.aud_source_create
  • Index Cond: (s.id = ANY ('{9046333,9046334,9046335,9046336,9046337,9046338}'::integer[]))
  • Filter: (s.time_type_id = 1)
  • Rows Removed by Filter: 1
  • Buffers: shared hit=19
5. 0.095 0.095 ↑ 1.0 1 5

Index Scan using pk_sr_timetable on public.sr_timetable tt (cost=0.42..8.44 rows=1 width=64) (actual time=0.017..0.019 rows=1 loops=5)

  • Output: tt.id, tt.bdate, tt.edate, tt.aud_who, tt.aud_when, tt.aud_source, tt.aud_who_create, tt.aud_when_create, tt.aud_source_create
  • Index Cond: (tt.id = s.timetable_id)
  • Buffers: shared hit=20
6. 0.115 0.115 ↑ 1.0 1 5

Index Scan using pk_sr_timetable_res_group on public.sr_timetable_res_group rg (cost=0.42..0.48 rows=1 width=60) (actual time=0.021..0.023 rows=1 loops=5)

  • Output: rg.id, rg.res_group_id, rg.aud_who, rg.aud_when, rg.aud_source, rg.aud_who_create, rg.aud_when_create, rg.aud_source_create
  • Index Cond: (rg.id = tt.id)
  • Buffers: shared hit=20
7. 779.135 779.135 ↓ 109.1 9,165 5

Index Scan using md_appointment_executor_id_idx on public.md_appointment a (cost=0.44..224.77 rows=84 width=729) (actual time=0.719..155.827 rows=9,165 loops=5)

  • Output: a.id, a.srv_rendered_id, a.executor_id, a.bdatetime, a.customer_id, a.funding_id, a.state_id, a.service_id, a.cancel_reason_id, a.care_regimen_id, a.care_level_id, a.referral_id, a.source_id, a.registrator_id, a.registration_dt, a.edatetime, a.is_urgent, a.notif_contact, a.price_list_id, a.message, a.queue_state_id, a.queue_change_dt, a.ticket_number, a.price, a.init_goal_id, a.organization_id, a.is_house_call, a.comment, a.aud_who, a.aud_when, a.aud_source, a.aud_who_create, a.aud_when_create, a.aud_source_create, a.reject_comment, a.reject_reason_id, a.way_id, a.is_cito, a.event_id, a.is_send_message, a.comment_send_message, a.cancel_dt, a.answer_portal_code
  • Index Cond: (a.executor_id = rg.res_group_id)
  • Filter: (a.is_urgent AND (a.state_id = ANY ('{0,2,3,5}'::integer[])) AND ((a.bdatetime >= ('now'::cstring)::date) OR (a.state_id <> ALL ('{0,2,5}'::integer[]))))
  • Rows Removed by Filter: 30133
  • Buffers: shared hit=179255
Planning time : 4.602 ms
Execution time : 788.591 ms