explain.depesz.com

PostgreSQL's explain analyze made readable

Result: clIk

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 0.034 ↓ 0.0 0 1

Nested Loop (cost=1.71..1,154.11 rows=29 width=983) (actual time=0.034..0.034 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))
  • Buffers: shared hit=18
2. 0.000 0.033 ↓ 0.0 0 1

Nested Loop (cost=1.27..76.20 rows=5 width=212) (actual time=0.033..0.033 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
  • Join Filter: (s.timetable_id = rg.id)
  • Buffers: shared hit=18
3. 0.002 0.033 ↓ 0.0 0 1

Nested Loop (cost=0.85..73.73 rows=5 width=152) (actual time=0.033..0.033 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, 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=18
4. 0.031 0.031 ↓ 0.0 0 1

Index Scan using sr_shift_pk on public.sr_shift s (cost=0.43..31.50 rows=5 width=88) (actual time=0.031..0.031 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
  • Index Cond: (s.id = ANY ('{9046333,9046334,9046335,9046336,9046337,9046338}'::integer[]))
  • Filter: (s.time_type_id = 1)
  • Buffers: shared hit=18
5. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_sr_timetable on public.sr_timetable tt (cost=0.42..8.44 rows=1 width=64) (never executed)

  • 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)
6. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_sr_timetable_res_group on public.sr_timetable_res_group rg (cost=0.42..0.48 rows=1 width=60) (never executed)

  • 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)
7. 0.000 0.000 ↓ 0.0 0

Index Scan using md_appointment_executor_id_idx on public.md_appointment a (cost=0.44..214.46 rows=75 width=771) (never executed)

  • 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[]))))
Planning time : 431.812 ms
Execution time : 0.295 ms