explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Hukb

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 4,185.328 ↑ 1.0 1 1

Limit (cost=222.78..3,532.49 rows=1 width=1,828) (actual time=4,185.328..4,185.328 rows=1 loops=1)

  • Output: ((((to_char((pat_ind.birth_dt)::timestamp with time zone, 'DD.MM.YYYY'::text) || ' ('::text) || (date_part('year'::text, age(now(), (pat_ind.birth_dt)::timestamp with time zone)))::text) || ')'::text)), pat_gender.name, ((SubPlan 1)), ((SubPlan 2)), sg.name, ((SubPlan 3)), ((SubPlan 5)), ((SubPlan 7)), c.id, pat_ind.id, c.uid, c.funding_id, ((SubPlan 8)), r.id, ref_org.id, (COALESCE(ref_org.short_name, ref_org.full_name)), ref_diag.id, ((((ref_diag.code)::text || ' '::text) || (ref_diag.name)::text)), r.order_number, r.referral_date, ref_dep.id, ref_dep.name, r.referral_type_id, r.ref_doctor_id, r.ref_doctor_id, ref_type.name, ref_type.code, r.ref_organization_code, r.ref_doctor_code, r.ref_doctor_code, r.ref_organization_code, r.ref_doctor_id, ((SubPlan 10)), md_care_providing_form.id, md_care_providing_form.name, drunkenness_type.id, drunkenness_type.name, admission_reason.id, admission_reason.name, c.who_delivered_code, c.who_delivered_team_number, time_gone.id, time_gone.name, mc_case_init_goal.id, mc_case_init_goal.name, repeat_count.id, repeat_count.name, hc.id, hc.name, ((SubPlan 11)), ((SubPlan 12)), ((SubPlan 13)), ((SubPlan 14)), ((SubPlan 15)), ((SubPlan 16)), ((SubPlan 17)), ((SubPlan 18)), ((SubPlan 19)), sl.id, ((SubPlan 20)), ((SubPlan 21)), ((SubPlan 22)), ((SubPlan 23)), ((SubPlan 24)), ((SubPlan 25)), case_result.id, psd.id, c.closing_step_id, ((SubPlan 26)), ((SubPlan 27)), ((SubPlan 28)), ((SubPlan 29)), c.transporting_type_id, c.care_level_id, c.payment_method_id, c.care_regimen_id, c.id, c.clinic_id, ((SubPlan 30)), c.rankin_scale_for_admission_id, c.rankin_scale_on_disposal_id, c.is_finance_type_control, c.is_finance_type_control, ((alternatives: SubPlan 31 or hashed SubPlan 32)), ((alternatives: SubPlan 33 or hashed SubPlan 34)), c.create_date, ($68), r.proposed_date, c.ticket_vmp, c.ticket_vmp_date, r.proposed_date, c.ticket_vmp, c.ticket_vmp_date, mcs.onko_stage, mcs.gestational_age, ($70), ($72), (((((main_diag.code)::text ~~ '%C%'::text) AND ((main_diag.code)::text >= 'C00'::text) AND ((main_diag.code)::text <= 'C80.9'::text)) OR ((main_diag.code)::text ~~ '%C97%'::text))), ((((main_diag.code)::text ~~ '%O%'::text) AND ((main_diag.code)::text >= 'O00'::text) AND ((main_diag.code)::text <= 'O99.9'::text) AND ((main_diag.code)::text <> ALL ('{O26.2,O26.7}'::text[])) AND (((main_diag.code)::text < 'O85'::text) OR ((main_diag.code)::text > 'O87.9'::text)) AND (((main_diag.code)::text < 'O89'::text) OR ((main_diag.code)::text > 'O92.7'::text)) AND (((main_diag.code)::text < 'O96'::text) OR ((main_diag.code)::text > 'O99.8'::text)))), ((SubPlan 40)), ((alternatives: SubPlan 41 or hashed SubPlan 42)), (COALESCE((('№'::text || (c.uid)::text) || ','::text), ''::text)), (((COALESCE(((pat_ind.surname)::text || ' '::text), ''::text) || COALESCE(((pat_ind.name)::text || ' '::text), ''::text)) || (COALESCE(pat_ind.patr_name, ''::character varying))::text)), msl.id, msl.name, c.rankin_scale_for_admission_id, ((SubPlan 43)), r.bed_profile_id, mbp.name, r.department_id, ((SubPlan 44)), r.profile_id, mp.name, c.narcotic_substance, c.where_from_delivered
  • Buffers: shared hit=1646588
2.          

Initplan (forLimit)

3. 0.000 0.105 ↑ 1.0 1 1

Limit (cost=167.83..175.85 rows=1 width=36) (actual time=0.105..0.105 rows=1 loops=1)

  • Output: (COALESCE($67, (s_14.default_value)::boolean))
  • Buffers: shared hit=11
4.          

Initplan (forLimit)

5. 0.000 0.074 ↓ 0.0 0 1

Limit (cost=13.97..167.55 rows=1 width=91) (actual time=0.074..0.074 rows=0 loops=1)

  • Output: ((sv.value)::boolean)
  • Buffers: shared hit=8
6. 0.002 0.074 ↓ 0.0 0 1

Nested Loop (cost=13.97..474.71 rows=3 width=91) (actual time=0.074..0.074 rows=0 loops=1)

  • Output: (sv.value)::boolean
  • Join Filter: (sc.type_id = st.id)
  • Buffers: shared hit=8
7. 0.019 0.019 ↑ 1.0 1 1

Seq Scan on public.cmn_scope_type st (cost=0.00..2.23 rows=1 width=4) (actual time=0.014..0.019 rows=1 loops=1)

  • Output: st.id, st.code, st.name, st.table_name, st.finder_id, st.parent_id, st.aud_who, st.aud_when, st.aud_source, st.aud_who_create, st.aud_when_create, st.aud_source_create
  • Filter: ((st.code)::text = 'Global'::text)
  • Rows Removed by Filter: 17
  • Buffers: shared hit=2
8. 0.000 0.053 ↓ 0.0 0 1

Nested Loop (cost=13.97..471.70 rows=62 width=95) (actual time=0.053..0.053 rows=0 loops=1)

  • Output: sv.value, sc.type_id
  • Buffers: shared hit=6
9. 0.003 0.053 ↓ 0.0 0 1

Nested Loop (cost=13.69..451.93 rows=62 width=95) (actual time=0.053..0.053 rows=0 loops=1)

  • Output: sv.value, sv.scope_id
  • Buffers: shared hit=6
10. 0.013 0.013 ↑ 1.0 1 1

Index Scan using cmn_setting_code_ak on public.cmn_setting s_13 (cost=0.28..8.29 rows=1 width=93) (actual time=0.012..0.013 rows=1 loops=1)

  • Output: s_13.code, s_13.default_value, s_13.description, s_13.is_mondatory, s_13.name, s_13.view_order, s_13.domain_id, s_13.module_id, s_13.scopes_version, s_13.default_value_version, s_13.name_version, s_13.id, s_13.group_id, s_13.aud_who, s_13.aud_when, s_13.aud_source, s_13.aud_who_create, s_13.aud_when_create, s_13.aud_source_create
  • Index Cond: ((s_13.code)::text = 'cz.atria.medcase.ui.MedicalCaseUISettings.autoCreateHospitalDocuments'::text)
  • Buffers: shared hit=3
11. 0.005 0.037 ↓ 0.0 0 1

Bitmap Heap Scan on public.cmn_setting_value sv (cost=13.41..442.36 rows=128 width=192) (actual time=0.037..0.037 rows=0 loops=1)

  • Output: sv.scope_id, sv.setting_id, sv.value, sv.aud_who, sv.aud_when, sv.aud_source, sv.aud_who_create, sv.aud_when_create, sv.aud_source_create
  • Recheck Cond: ((sv.setting_id)::text = (s_13.id)::text)
  • Buffers: shared hit=3
12. 0.032 0.032 ↓ 0.0 0 1

Bitmap Index Scan on cmn_setting_value_setting_id_idx (cost=0.00..13.38 rows=128 width=0) (actual time=0.032..0.032 rows=0 loops=1)

  • Index Cond: ((sv.setting_id)::text = (s_13.id)::text)
  • Buffers: shared hit=3
13. 0.000 0.000 ↓ 0.0 0

Index Scan using cmn_scope_pk on public.cmn_scope sc (cost=0.29..0.31 rows=1 width=8) (never executed)

  • Output: sc.id, sc.type_id, sc.aud_who, sc.aud_when, sc.aud_source, sc.aud_who_create, sc.aud_when_create, sc.aud_source_create
  • Index Cond: (sc.id = sv.scope_id)
14. 0.105 0.105 ↑ 1.0 1 1

Index Scan using cmn_setting_code_ak on public.cmn_setting s_14 (cost=0.28..8.30 rows=1 width=36) (actual time=0.105..0.105 rows=1 loops=1)

  • Output: COALESCE($67, (s_14.default_value)::boolean)
  • Index Cond: ((s_14.code)::text = 'cz.atria.medcase.ui.MedicalCaseUISettings.autoCreateHospitalDocuments'::text)
  • Buffers: shared hit=11
15. 0.000 0.043 ↑ 1.0 1 1

Limit (cost=13.69..20.77 rows=1 width=127) (actual time=0.043..0.043 rows=1 loops=1)

  • Output: (CASE WHEN ((sv_1.value IS NOT NULL) AND (sv_1.value <> ''::text)) THEN (sv_1.value)::boolean ELSE (s_15.default_value)::boolean END)
  • Buffers: shared hit=6
16. 0.006 0.043 ↑ 62.0 1 1

Nested Loop Left Join (cost=13.69..452.71 rows=62 width=127) (actual time=0.043..0.043 rows=1 loops=1)

  • Output: CASE WHEN ((sv_1.value IS NOT NULL) AND (sv_1.value <> ''::text)) THEN (sv_1.value)::boolean ELSE (s_15.default_value)::boolean END
  • Buffers: shared hit=6
17. 0.020 0.020 ↑ 1.0 1 1

Index Scan using cmn_setting_code_ak on public.cmn_setting s_15 (cost=0.28..8.29 rows=1 width=129) (actual time=0.020..0.020 rows=1 loops=1)

  • Output: s_15.code, s_15.default_value, s_15.description, s_15.is_mondatory, s_15.name, s_15.view_order, s_15.domain_id, s_15.module_id, s_15.scopes_version, s_15.default_value_version, s_15.name_version, s_15.id, s_15.group_id, s_15.aud_who, s_15.aud_when, s_15.aud_source, s_15.aud_who_create, s_15.aud_when_create, s_15.aud_source_create
  • Index Cond: ((s_15.code)::text = 'cz.atria.medcase.ui.MedicalCaseUISettings.onkoStage'::text)
  • Buffers: shared hit=3
18. 0.000 0.017 ↓ 0.0 0 1

Bitmap Heap Scan on public.cmn_setting_value sv_1 (cost=13.41..442.36 rows=128 width=192) (actual time=0.017..0.017 rows=0 loops=1)

  • Output: sv_1.scope_id, sv_1.setting_id, sv_1.value, sv_1.aud_who, sv_1.aud_when, sv_1.aud_source, sv_1.aud_who_create, sv_1.aud_when_create, sv_1.aud_source_create
  • Recheck Cond: ((sv_1.setting_id)::text = (s_15.id)::text)
  • Buffers: shared hit=3
19. 0.017 0.017 ↓ 0.0 0 1

Bitmap Index Scan on cmn_setting_value_setting_id_idx (cost=0.00..13.38 rows=128 width=0) (actual time=0.017..0.017 rows=0 loops=1)

  • Index Cond: ((sv_1.setting_id)::text = (s_15.id)::text)
  • Buffers: shared hit=3
20. 0.000 0.036 ↑ 1.0 1 1

Limit (cost=13.69..20.77 rows=1 width=127) (actual time=0.036..0.036 rows=1 loops=1)

  • Output: (CASE WHEN ((sv_2.value IS NOT NULL) AND (sv_2.value <> ''::text)) THEN (sv_2.value)::boolean ELSE (s_16.default_value)::boolean END)
  • Buffers: shared hit=6
21. 0.003 0.036 ↑ 62.0 1 1

Nested Loop Left Join (cost=13.69..452.71 rows=62 width=127) (actual time=0.036..0.036 rows=1 loops=1)

  • Output: CASE WHEN ((sv_2.value IS NOT NULL) AND (sv_2.value <> ''::text)) THEN (sv_2.value)::boolean ELSE (s_16.default_value)::boolean END
  • Buffers: shared hit=6
22. 0.016 0.016 ↑ 1.0 1 1

Index Scan using cmn_setting_code_ak on public.cmn_setting s_16 (cost=0.28..8.29 rows=1 width=129) (actual time=0.016..0.016 rows=1 loops=1)

  • Output: s_16.code, s_16.default_value, s_16.description, s_16.is_mondatory, s_16.name, s_16.view_order, s_16.domain_id, s_16.module_id, s_16.scopes_version, s_16.default_value_version, s_16.name_version, s_16.id, s_16.group_id, s_16.aud_who, s_16.aud_when, s_16.aud_source, s_16.aud_who_create, s_16.aud_when_create, s_16.aud_source_create
  • Index Cond: ((s_16.code)::text = 'cz.atria.medcase.ui.MedicalCaseUISettings.gestationalAge'::text)
  • Buffers: shared hit=3
23. 0.001 0.017 ↓ 0.0 0 1

Bitmap Heap Scan on public.cmn_setting_value sv_2 (cost=13.41..442.36 rows=128 width=192) (actual time=0.017..0.017 rows=0 loops=1)

  • Output: sv_2.scope_id, sv_2.setting_id, sv_2.value, sv_2.aud_who, sv_2.aud_when, sv_2.aud_source, sv_2.aud_who_create, sv_2.aud_when_create, sv_2.aud_source_create
  • Recheck Cond: ((sv_2.setting_id)::text = (s_16.id)::text)
  • Buffers: shared hit=3
24. 0.016 0.016 ↓ 0.0 0 1

Bitmap Index Scan on cmn_setting_value_setting_id_idx (cost=0.00..13.38 rows=128 width=0) (actual time=0.016..0.016 rows=0 loops=1)

  • Index Cond: ((sv_2.setting_id)::text = (s_16.id)::text)
  • Buffers: shared hit=3
25. 2,252.592 4,185.326 ↑ 49,178,088.0 1 1

Nested Loop Left Join (cost=5.40..162,765,249,498.97 rows=49,178,088 width=1,828) (actual time=4,185.326..4,185.326 rows=1 loops=1)

  • Output: (((to_char((pat_ind.birth_dt)::timestamp with time zone, 'DD.MM.YYYY'::text) || ' ('::text) || (date_part('year'::text, age(now(), (pat_ind.birth_dt)::timestamp with time zone)))::text) || ')'::text), pat_gender.name, (SubPlan 1), (SubPlan 2), sg.name, (SubPlan 3), (SubPlan 5), (SubPlan 7), c.id, pat_ind.id, c.uid, c.funding_id, (SubPlan 8), r.id, ref_org.id, COALESCE(ref_org.short_name, ref_org.full_name), ref_diag.id, (((ref_diag.code)::text || ' '::text) || (ref_diag.name)::text), r.order_number, r.referral_date, ref_dep.id, ref_dep.name, r.referral_type_id, r.ref_doctor_id, r.ref_doctor_id, ref_type.name, ref_type.code, r.ref_organization_code, r.ref_doctor_code, r.ref_doctor_code, r.ref_organization_code, r.ref_doctor_id, (SubPlan 10), md_care_providing_form.id, md_care_providing_form.name, drunkenness_type.id, drunkenness_type.name, admission_reason.id, admission_reason.name, c.who_delivered_code, c.who_delivered_team_number, time_gone.id, time_gone.name, mc_case_init_goal.id, mc_case_init_goal.name, repeat_count.id, repeat_count.name, hc.id, hc.name, (SubPlan 11), (SubPlan 12), (SubPlan 13), (SubPlan 14), (SubPlan 15), (SubPlan 16), (SubPlan 17), (SubPlan 18), (SubPlan 19), sl.id, (SubPlan 20), (SubPlan 21), (SubPlan 22), (SubPlan 23), (SubPlan 24), (SubPlan 25), case_result.id, psd.id, c.closing_step_id, (SubPlan 26), (SubPlan 27), (SubPlan 28), (SubPlan 29), c.transporting_type_id, c.care_level_id, c.payment_method_id, c.care_regimen_id, c.id, c.clinic_id, (SubPlan 30), c.rankin_scale_for_admission_id, c.rankin_scale_on_disposal_id, c.is_finance_type_control, c.is_finance_type_control, (alternatives: SubPlan 31 or hashed SubPlan 32), (alternatives: SubPlan 33 or hashed SubPlan 34), c.create_date, $68, r.proposed_date, c.ticket_vmp, c.ticket_vmp_date, r.proposed_date, c.ticket_vmp, c.ticket_vmp_date, mcs.onko_stage, mcs.gestational_age, $70, $72, ((((main_diag.code)::text ~~ '%C%'::text) AND ((main_diag.code)::text >= 'C00'::text) AND ((main_diag.code)::text <= 'C80.9'::text)) OR ((main_diag.code)::text ~~ '%C97%'::text)), (((main_diag.code)::text ~~ '%O%'::text) AND ((main_diag.code)::text >= 'O00'::text) AND ((main_diag.code)::text <= 'O99.9'::text) AND ((main_diag.code)::text <> ALL ('{O26.2,O26.7}'::text[])) AND (((main_diag.code)::text < 'O85'::text) OR ((main_diag.code)::text > 'O87.9'::text)) AND (((main_diag.code)::text < 'O89'::text) OR ((main_diag.code)::text > 'O92.7'::text)) AND (((main_diag.code)::text < 'O96'::text) OR ((main_diag.code)::text > 'O99.8'::text))), (SubPlan 40), (alternatives: SubPlan 41 or hashed SubPlan 42), COALESCE((('№'::text || (c.uid)::text) || ','::text), ''::text), ((COALESCE(((pat_ind.surname)::text || ' '::text), ''::text) || COALESCE(((pat_ind.name)::text || ' '::text), ''::text)) || (COALESCE(pat_ind.patr_name, ''::character varying))::text), msl.id, msl.name, c.rankin_scale_for_admission_id, (SubPlan 43), r.bed_profile_id, mbp.name, r.department_id, (SubPlan 44), r.profile_id, mp.name, c.narcotic_substance, c.where_from_delivered
  • Buffers: shared hit=1646588
26. 0.001 0.478 ↑ 49,178,088.0 1 1

Nested Loop Left Join (cost=5.11..294,777,153.69 rows=49,178,088 width=1,827) (actual time=0.478..0.478 rows=1 loops=1)

  • Output: c.patient_id, c.id, c.uid, c.funding_id, c.who_delivered_code, c.who_delivered_team_number, c.closing_step_id, c.transporting_type_id, c.care_level_id, c.payment_method_id, c.care_regimen_id, c.clinic_id, c.rankin_scale_for_admission_id, c.rankin_scale_on_disposal_id, c.is_finance_type_control, c.create_date, c.ticket_vmp, c.ticket_vmp_date, c.narcotic_substance, c.where_from_delivered, sg.name, pat_ind.birth_dt, pat_ind.id, pat_ind.surname, pat_ind.name, pat_ind.patr_name, pat_gender.name, r.id, r.order_number, r.referral_date, r.referral_type_id, r.ref_doctor_id, r.ref_organization_code, r.ref_doctor_code, r.proposed_date, r.bed_profile_id, r.department_id, r.profile_id, ref_org.id, ref_org.short_name, ref_org.full_name, ref_dep.id, ref_dep.name, ref_diag.id, ref_diag.code, ref_diag.name, ref_type.name, ref_type.code, admission_reason.id, admission_reason.name, time_gone.id, time_gone.name, repeat_count.id, repeat_count.name, md_care_providing_form.id, md_care_providing_form.name, drunkenness_type.id, drunkenness_type.name, mc_case_init_goal.id, mc_case_init_goal.name, case_result.id, psd.id, hc.id, hc.name, sl.id, msl.id, msl.name, mp.name, mbp.name, mcr.id, mcs.onko_stage, mcs.gestational_age, mc_diagnosis.diagnos_id
  • Buffers: shared hit=46
27. 0.003 0.477 ↑ 49,178,088.0 1 1

Nested Loop Left Join (cost=4.54..259,873,957.26 rows=49,178,088 width=1,827) (actual time=0.477..0.477 rows=1 loops=1)

  • Output: c.patient_id, c.id, c.uid, c.funding_id, c.who_delivered_code, c.who_delivered_team_number, c.closing_step_id, c.transporting_type_id, c.care_level_id, c.payment_method_id, c.care_regimen_id, c.clinic_id, c.rankin_scale_for_admission_id, c.rankin_scale_on_disposal_id, c.is_finance_type_control, c.create_date, c.ticket_vmp, c.ticket_vmp_date, c.narcotic_substance, c.where_from_delivered, sg.name, pat_ind.birth_dt, pat_ind.id, pat_ind.surname, pat_ind.name, pat_ind.patr_name, pat_gender.name, r.id, r.order_number, r.referral_date, r.referral_type_id, r.ref_doctor_id, r.ref_organization_code, r.ref_doctor_code, r.proposed_date, r.bed_profile_id, r.department_id, r.profile_id, ref_org.id, ref_org.short_name, ref_org.full_name, ref_dep.id, ref_dep.name, ref_diag.id, ref_diag.code, ref_diag.name, ref_type.name, ref_type.code, admission_reason.id, admission_reason.name, time_gone.id, time_gone.name, repeat_count.id, repeat_count.name, md_care_providing_form.id, md_care_providing_form.name, drunkenness_type.id, drunkenness_type.name, mc_case_init_goal.id, mc_case_init_goal.name, case_result.id, psd.id, hc.id, hc.name, sl.id, msl.id, msl.name, mp.name, mbp.name, mcr.id, mcs.onko_stage, mcs.gestational_age, mcs.main_diagnosis_id
  • Buffers: shared hit=46
28. 0.005 0.455 ↑ 49,178,088.0 1 1

Nested Loop Left Join (cost=3.98..224,154,390.90 rows=49,178,088 width=1,815) (actual time=0.455..0.455 rows=1 loops=1)

  • Output: c.patient_id, c.id, c.uid, c.funding_id, c.who_delivered_code, c.who_delivered_team_number, c.closing_step_id, c.transporting_type_id, c.care_level_id, c.payment_method_id, c.care_regimen_id, c.clinic_id, c.rankin_scale_for_admission_id, c.rankin_scale_on_disposal_id, c.is_finance_type_control, c.create_date, c.ticket_vmp, c.ticket_vmp_date, c.narcotic_substance, c.where_from_delivered, sg.name, pat_ind.birth_dt, pat_ind.id, pat_ind.surname, pat_ind.name, pat_ind.patr_name, pat_gender.name, r.id, r.order_number, r.referral_date, r.referral_type_id, r.ref_doctor_id, r.ref_organization_code, r.ref_doctor_code, r.proposed_date, r.bed_profile_id, r.department_id, r.profile_id, ref_org.id, ref_org.short_name, ref_org.full_name, ref_dep.id, ref_dep.name, ref_diag.id, ref_diag.code, ref_diag.name, ref_type.name, ref_type.code, admission_reason.id, admission_reason.name, time_gone.id, time_gone.name, repeat_count.id, repeat_count.name, md_care_providing_form.id, md_care_providing_form.name, drunkenness_type.id, drunkenness_type.name, mc_case_init_goal.id, mc_case_init_goal.name, case_result.id, psd.id, hc.id, hc.name, sl.id, msl.id, msl.name, mp.name, mbp.name, mcr.id
  • Join Filter: (c.care_regimen_id = mcr.id)
  • Buffers: shared hit=41
29. 0.001 0.445 ↑ 49,178,088.0 1 1

Nested Loop Left Join (cost=3.98..218,253,019.24 rows=49,178,088 width=1,811) (actual time=0.445..0.445 rows=1 loops=1)

  • Output: c.patient_id, c.id, c.uid, c.funding_id, c.who_delivered_code, c.who_delivered_team_number, c.closing_step_id, c.transporting_type_id, c.care_level_id, c.payment_method_id, c.care_regimen_id, c.clinic_id, c.rankin_scale_for_admission_id, c.rankin_scale_on_disposal_id, c.is_finance_type_control, c.create_date, c.ticket_vmp, c.ticket_vmp_date, c.narcotic_substance, c.where_from_delivered, sg.name, pat_ind.birth_dt, pat_ind.id, pat_ind.surname, pat_ind.name, pat_ind.patr_name, pat_gender.name, r.id, r.order_number, r.referral_date, r.referral_type_id, r.ref_doctor_id, r.ref_organization_code, r.ref_doctor_code, r.proposed_date, r.bed_profile_id, r.department_id, r.profile_id, ref_org.id, ref_org.short_name, ref_org.full_name, ref_dep.id, ref_dep.name, ref_diag.id, ref_diag.code, ref_diag.name, ref_type.name, ref_type.code, admission_reason.id, admission_reason.name, time_gone.id, time_gone.name, repeat_count.id, repeat_count.name, md_care_providing_form.id, md_care_providing_form.name, drunkenness_type.id, drunkenness_type.name, mc_case_init_goal.id, mc_case_init_goal.name, case_result.id, psd.id, hc.id, hc.name, sl.id, msl.id, msl.name, mp.name, mbp.name
  • Buffers: shared hit=40
30. 0.001 0.443 ↑ 49,178,088.0 1 1

Nested Loop Left Join (cost=3.70..203,498,483.87 rows=49,178,088 width=1,718) (actual time=0.443..0.443 rows=1 loops=1)

  • Output: c.patient_id, c.id, c.uid, c.funding_id, c.who_delivered_code, c.who_delivered_team_number, c.closing_step_id, c.transporting_type_id, c.care_level_id, c.payment_method_id, c.care_regimen_id, c.clinic_id, c.rankin_scale_for_admission_id, c.rankin_scale_on_disposal_id, c.is_finance_type_control, c.create_date, c.ticket_vmp, c.ticket_vmp_date, c.narcotic_substance, c.where_from_delivered, sg.name, pat_ind.birth_dt, pat_ind.id, pat_ind.surname, pat_ind.name, pat_ind.patr_name, pat_gender.name, r.id, r.order_number, r.referral_date, r.referral_type_id, r.ref_doctor_id, r.ref_organization_code, r.ref_doctor_code, r.proposed_date, r.bed_profile_id, r.department_id, r.profile_id, ref_org.id, ref_org.short_name, ref_org.full_name, ref_dep.id, ref_dep.name, ref_diag.id, ref_diag.code, ref_diag.name, ref_type.name, ref_type.code, admission_reason.id, admission_reason.name, time_gone.id, time_gone.name, repeat_count.id, repeat_count.name, md_care_providing_form.id, md_care_providing_form.name, drunkenness_type.id, drunkenness_type.name, mc_case_init_goal.id, mc_case_init_goal.name, case_result.id, psd.id, hc.id, hc.name, sl.id, msl.id, msl.name, mp.name
  • Buffers: shared hit=40
31. 0.005 0.441 ↑ 49,178,088.0 1 1

Nested Loop Left Join (cost=3.56..195,014,630.00 rows=49,178,088 width=1,632) (actual time=0.441..0.441 rows=1 loops=1)

  • Output: c.patient_id, c.id, c.uid, c.funding_id, c.who_delivered_code, c.who_delivered_team_number, c.closing_step_id, c.transporting_type_id, c.care_level_id, c.payment_method_id, c.care_regimen_id, c.clinic_id, c.rankin_scale_for_admission_id, c.rankin_scale_on_disposal_id, c.is_finance_type_control, c.create_date, c.ticket_vmp, c.ticket_vmp_date, c.narcotic_substance, c.where_from_delivered, sg.name, pat_ind.birth_dt, pat_ind.id, pat_ind.surname, pat_ind.name, pat_ind.patr_name, pat_gender.name, r.id, r.order_number, r.referral_date, r.referral_type_id, r.ref_doctor_id, r.ref_organization_code, r.ref_doctor_code, r.proposed_date, r.bed_profile_id, r.department_id, r.profile_id, ref_org.id, ref_org.short_name, ref_org.full_name, ref_dep.id, ref_dep.name, ref_diag.id, ref_diag.code, ref_diag.name, ref_type.name, ref_type.code, admission_reason.id, admission_reason.name, time_gone.id, time_gone.name, repeat_count.id, repeat_count.name, md_care_providing_form.id, md_care_providing_form.name, drunkenness_type.id, drunkenness_type.name, mc_case_init_goal.id, mc_case_init_goal.name, case_result.id, psd.id, hc.id, hc.name, sl.id, msl.id, msl.name
  • Join Filter: (msl.id = c.severity_level_id)
  • Rows Removed by Join Filter: 5
  • Buffers: shared hit=40
32. 0.002 0.424 ↑ 49,178,088.0 1 1

Nested Loop Left Join (cost=3.56..191,326,272.33 rows=49,178,088 width=1,606) (actual time=0.424..0.424 rows=1 loops=1)

  • Output: c.patient_id, c.id, c.uid, c.funding_id, c.who_delivered_code, c.who_delivered_team_number, c.closing_step_id, c.transporting_type_id, c.care_level_id, c.payment_method_id, c.care_regimen_id, c.clinic_id, c.rankin_scale_for_admission_id, c.rankin_scale_on_disposal_id, c.is_finance_type_control, c.create_date, c.ticket_vmp, c.ticket_vmp_date, c.narcotic_substance, c.where_from_delivered, c.severity_level_id, sg.name, pat_ind.birth_dt, pat_ind.id, pat_ind.surname, pat_ind.name, pat_ind.patr_name, pat_gender.name, r.id, r.order_number, r.referral_date, r.referral_type_id, r.ref_doctor_id, r.ref_organization_code, r.ref_doctor_code, r.proposed_date, r.bed_profile_id, r.department_id, r.profile_id, ref_org.id, ref_org.short_name, ref_org.full_name, ref_dep.id, ref_dep.name, ref_diag.id, ref_diag.code, ref_diag.name, ref_type.name, ref_type.code, admission_reason.id, admission_reason.name, time_gone.id, time_gone.name, repeat_count.id, repeat_count.name, md_care_providing_form.id, md_care_providing_form.name, drunkenness_type.id, drunkenness_type.name, mc_case_init_goal.id, mc_case_init_goal.name, case_result.id, psd.id, hc.id, hc.name, sl.id
  • Buffers: shared hit=39
33. 0.002 0.407 ↑ 49,178,088.0 1 1

Nested Loop Left Join (cost=3.14..164,254,195.93 rows=49,178,088 width=1,602) (actual time=0.407..0.407 rows=1 loops=1)

  • Output: c.patient_id, c.id, c.uid, c.funding_id, c.who_delivered_code, c.who_delivered_team_number, c.closing_step_id, c.transporting_type_id, c.care_level_id, c.payment_method_id, c.care_regimen_id, c.clinic_id, c.rankin_scale_for_admission_id, c.rankin_scale_on_disposal_id, c.is_finance_type_control, c.create_date, c.ticket_vmp, c.ticket_vmp_date, c.narcotic_substance, c.where_from_delivered, c.severity_level_id, sg.name, pat_ind.birth_dt, pat_ind.id, pat_ind.surname, pat_ind.name, pat_ind.patr_name, pat_gender.name, r.id, r.order_number, r.referral_date, r.referral_type_id, r.ref_doctor_id, r.ref_organization_code, r.ref_doctor_code, r.proposed_date, r.bed_profile_id, r.department_id, r.profile_id, ref_org.id, ref_org.short_name, ref_org.full_name, ref_dep.id, ref_dep.name, ref_diag.id, ref_diag.code, ref_diag.name, ref_type.name, ref_type.code, admission_reason.id, admission_reason.name, time_gone.id, time_gone.name, repeat_count.id, repeat_count.name, md_care_providing_form.id, md_care_providing_form.name, drunkenness_type.id, drunkenness_type.name, mc_case_init_goal.id, mc_case_init_goal.name, case_result.id, psd.id, hc.id, hc.name
  • Buffers: shared hit=36
34. 0.014 0.405 ↑ 49,178,088.0 1 1

Nested Loop Left Join (cost=3.00..155,893,876.97 rows=49,178,088 width=1,086) (actual time=0.405..0.405 rows=1 loops=1)

  • Output: c.patient_id, c.id, c.uid, c.funding_id, c.who_delivered_code, c.who_delivered_team_number, c.closing_step_id, c.transporting_type_id, c.care_level_id, c.payment_method_id, c.care_regimen_id, c.clinic_id, c.rankin_scale_for_admission_id, c.rankin_scale_on_disposal_id, c.is_finance_type_control, c.create_date, c.ticket_vmp, c.ticket_vmp_date, c.narcotic_substance, c.where_from_delivered, c.hsp_canal_id, c.severity_level_id, sg.name, pat_ind.birth_dt, pat_ind.id, pat_ind.surname, pat_ind.name, pat_ind.patr_name, pat_gender.name, r.id, r.order_number, r.referral_date, r.referral_type_id, r.ref_doctor_id, r.ref_organization_code, r.ref_doctor_code, r.proposed_date, r.bed_profile_id, r.department_id, r.profile_id, ref_org.id, ref_org.short_name, ref_org.full_name, ref_dep.id, ref_dep.name, ref_diag.id, ref_diag.code, ref_diag.name, ref_type.name, ref_type.code, admission_reason.id, admission_reason.name, time_gone.id, time_gone.name, repeat_count.id, repeat_count.name, md_care_providing_form.id, md_care_providing_form.name, drunkenness_type.id, drunkenness_type.name, mc_case_init_goal.id, mc_case_init_goal.name, case_result.id, psd.id
  • Join Filter: (psd.id = c.prehospital_stage_defect_id)
  • Rows Removed by Join Filter: 4
  • Buffers: shared hit=36
35. 0.003 0.382 ↑ 49,178,088.0 1 1

Nested Loop Left Join (cost=3.00..152,943,190.64 rows=49,178,088 width=1,086) (actual time=0.382..0.382 rows=1 loops=1)

  • Output: c.patient_id, c.id, c.uid, c.funding_id, c.who_delivered_code, c.who_delivered_team_number, c.closing_step_id, c.transporting_type_id, c.care_level_id, c.payment_method_id, c.care_regimen_id, c.clinic_id, c.rankin_scale_for_admission_id, c.rankin_scale_on_disposal_id, c.is_finance_type_control, c.create_date, c.ticket_vmp, c.ticket_vmp_date, c.narcotic_substance, c.where_from_delivered, c.prehospital_stage_defect_id, c.hsp_canal_id, c.severity_level_id, sg.name, pat_ind.birth_dt, pat_ind.id, pat_ind.surname, pat_ind.name, pat_ind.patr_name, pat_gender.name, r.id, r.order_number, r.referral_date, r.referral_type_id, r.ref_doctor_id, r.ref_organization_code, r.ref_doctor_code, r.proposed_date, r.bed_profile_id, r.department_id, r.profile_id, ref_org.id, ref_org.short_name, ref_org.full_name, ref_dep.id, ref_dep.name, ref_diag.id, ref_diag.code, ref_diag.name, ref_type.name, ref_type.code, admission_reason.id, admission_reason.name, time_gone.id, time_gone.name, repeat_count.id, repeat_count.name, md_care_providing_form.id, md_care_providing_form.name, drunkenness_type.id, drunkenness_type.name, mc_case_init_goal.id, mc_case_init_goal.name, case_result.id
  • Buffers: shared hit=35
36. 0.003 0.378 ↑ 49,178,088.0 1 1

Nested Loop Left Join (cost=2.56..130,221,534.16 rows=49,178,088 width=1,086) (actual time=0.378..0.378 rows=1 loops=1)

  • Output: c.patient_id, c.id, c.uid, c.funding_id, c.who_delivered_code, c.who_delivered_team_number, c.closing_step_id, c.transporting_type_id, c.care_level_id, c.payment_method_id, c.care_regimen_id, c.clinic_id, c.rankin_scale_for_admission_id, c.rankin_scale_on_disposal_id, c.is_finance_type_control, c.create_date, c.ticket_vmp, c.ticket_vmp_date, c.narcotic_substance, c.where_from_delivered, c.result_id, c.prehospital_stage_defect_id, c.hsp_canal_id, c.severity_level_id, sg.name, pat_ind.birth_dt, pat_ind.id, pat_ind.surname, pat_ind.name, pat_ind.patr_name, pat_gender.name, r.id, r.order_number, r.referral_date, r.referral_type_id, r.ref_doctor_id, r.ref_organization_code, r.ref_doctor_code, r.proposed_date, r.bed_profile_id, r.department_id, r.profile_id, ref_org.id, ref_org.short_name, ref_org.full_name, ref_dep.id, ref_dep.name, ref_diag.id, ref_diag.code, ref_diag.name, ref_type.name, ref_type.code, admission_reason.id, admission_reason.name, time_gone.id, time_gone.name, repeat_count.id, repeat_count.name, md_care_providing_form.id, md_care_providing_form.name, drunkenness_type.id, drunkenness_type.name, mc_case_init_goal.id, mc_case_init_goal.name
  • Buffers: shared hit=35
37. 0.014 0.363 ↑ 49,178,088.0 1 1

Nested Loop Left Join (cost=2.43..122,107,137.64 rows=49,178,088 width=935) (actual time=0.363..0.363 rows=1 loops=1)

  • Output: c.patient_id, c.id, c.uid, c.funding_id, c.who_delivered_code, c.who_delivered_team_number, c.closing_step_id, c.transporting_type_id, c.care_level_id, c.payment_method_id, c.care_regimen_id, c.clinic_id, c.rankin_scale_for_admission_id, c.rankin_scale_on_disposal_id, c.is_finance_type_control, c.create_date, c.ticket_vmp, c.ticket_vmp_date, c.narcotic_substance, c.where_from_delivered, c.init_goal_id, c.result_id, c.prehospital_stage_defect_id, c.hsp_canal_id, c.severity_level_id, sg.name, pat_ind.birth_dt, pat_ind.id, pat_ind.surname, pat_ind.name, pat_ind.patr_name, pat_gender.name, r.id, r.order_number, r.referral_date, r.referral_type_id, r.ref_doctor_id, r.ref_organization_code, r.ref_doctor_code, r.proposed_date, r.bed_profile_id, r.department_id, r.profile_id, ref_org.id, ref_org.short_name, ref_org.full_name, ref_dep.id, ref_dep.name, ref_diag.id, ref_diag.code, ref_diag.name, ref_type.name, ref_type.code, admission_reason.id, admission_reason.name, time_gone.id, time_gone.name, repeat_count.id, repeat_count.name, md_care_providing_form.id, md_care_providing_form.name, drunkenness_type.id, drunkenness_type.name
  • Join Filter: (drunkenness_type.id = c.drunkenness_type_id)
  • Rows Removed by Join Filter: 9
  • Buffers: shared hit=33
38. 0.003 0.335 ↑ 49,178,088.0 1 1

Nested Loop Left Join (cost=2.43..115,468,094.65 rows=49,178,088 width=882) (actual time=0.335..0.335 rows=1 loops=1)

  • Output: c.patient_id, c.id, c.uid, c.funding_id, c.who_delivered_code, c.who_delivered_team_number, c.closing_step_id, c.transporting_type_id, c.care_level_id, c.payment_method_id, c.care_regimen_id, c.clinic_id, c.rankin_scale_for_admission_id, c.rankin_scale_on_disposal_id, c.is_finance_type_control, c.create_date, c.ticket_vmp, c.ticket_vmp_date, c.narcotic_substance, c.where_from_delivered, c.drunkenness_type_id, c.init_goal_id, c.result_id, c.prehospital_stage_defect_id, c.hsp_canal_id, c.severity_level_id, sg.name, pat_ind.birth_dt, pat_ind.id, pat_ind.surname, pat_ind.name, pat_ind.patr_name, pat_gender.name, r.id, r.order_number, r.referral_date, r.referral_type_id, r.ref_doctor_id, r.ref_organization_code, r.ref_doctor_code, r.proposed_date, r.bed_profile_id, r.department_id, r.profile_id, ref_org.id, ref_org.short_name, ref_org.full_name, ref_dep.id, ref_dep.name, ref_diag.id, ref_diag.code, ref_diag.name, ref_type.name, ref_type.code, admission_reason.id, admission_reason.name, time_gone.id, time_gone.name, repeat_count.id, repeat_count.name, md_care_providing_form.id, md_care_providing_form.name
  • Join Filter: (md_care_providing_form.id = c.care_providing_form_id)
  • Rows Removed by Join Filter: 2
  • Buffers: shared hit=32
39. 0.004 0.322 ↑ 49,178,088.0 1 1

Nested Loop Left Join (cost=2.43..113,255,079.65 rows=49,178,088 width=863) (actual time=0.322..0.322 rows=1 loops=1)

  • Output: c.patient_id, c.id, c.uid, c.funding_id, c.who_delivered_code, c.who_delivered_team_number, c.closing_step_id, c.transporting_type_id, c.care_level_id, c.payment_method_id, c.care_regimen_id, c.clinic_id, c.rankin_scale_for_admission_id, c.rankin_scale_on_disposal_id, c.is_finance_type_control, c.create_date, c.ticket_vmp, c.ticket_vmp_date, c.narcotic_substance, c.where_from_delivered, c.care_providing_form_id, c.drunkenness_type_id, c.init_goal_id, c.result_id, c.prehospital_stage_defect_id, c.hsp_canal_id, c.severity_level_id, sg.name, pat_ind.birth_dt, pat_ind.id, pat_ind.surname, pat_ind.name, pat_ind.patr_name, pat_gender.name, r.id, r.order_number, r.referral_date, r.referral_type_id, r.ref_doctor_id, r.ref_organization_code, r.ref_doctor_code, r.proposed_date, r.bed_profile_id, r.department_id, r.profile_id, ref_org.id, ref_org.short_name, ref_org.full_name, ref_dep.id, ref_dep.name, ref_diag.id, ref_diag.code, ref_diag.name, ref_type.name, ref_type.code, admission_reason.id, admission_reason.name, time_gone.id, time_gone.name, repeat_count.id, repeat_count.name
  • Join Filter: (repeat_count.id = c.repeat_count_id)
  • Buffers: shared hit=31
40. 0.005 0.309 ↑ 49,178,088.0 1 1

Nested Loop Left Join (cost=2.43..111,779,735.99 rows=49,178,088 width=846) (actual time=0.309..0.309 rows=1 loops=1)

  • Output: c.patient_id, c.id, c.uid, c.funding_id, c.who_delivered_code, c.who_delivered_team_number, c.closing_step_id, c.transporting_type_id, c.care_level_id, c.payment_method_id, c.care_regimen_id, c.clinic_id, c.rankin_scale_for_admission_id, c.rankin_scale_on_disposal_id, c.is_finance_type_control, c.create_date, c.ticket_vmp, c.ticket_vmp_date, c.narcotic_substance, c.where_from_delivered, c.repeat_count_id, c.care_providing_form_id, c.drunkenness_type_id, c.init_goal_id, c.result_id, c.prehospital_stage_defect_id, c.hsp_canal_id, c.severity_level_id, sg.name, pat_ind.birth_dt, pat_ind.id, pat_ind.surname, pat_ind.name, pat_ind.patr_name, pat_gender.name, r.id, r.order_number, r.referral_date, r.referral_type_id, r.ref_doctor_id, r.ref_organization_code, r.ref_doctor_code, r.proposed_date, r.bed_profile_id, r.department_id, r.profile_id, ref_org.id, ref_org.short_name, ref_org.full_name, ref_dep.id, ref_dep.name, ref_diag.id, ref_diag.code, ref_diag.name, ref_type.name, ref_type.code, admission_reason.id, admission_reason.name, time_gone.id, time_gone.name
  • Join Filter: (time_gone.id = c.time_gone_id)
  • Rows Removed by Join Filter: 4
  • Buffers: shared hit=30
41. 0.008 0.290 ↑ 49,178,088.0 1 1

Nested Loop Left Join (cost=2.43..108,829,049.66 rows=49,178,088 width=819) (actual time=0.290..0.290 rows=1 loops=1)

  • Output: c.patient_id, c.id, c.uid, c.funding_id, c.who_delivered_code, c.who_delivered_team_number, c.closing_step_id, c.transporting_type_id, c.care_level_id, c.payment_method_id, c.care_regimen_id, c.clinic_id, c.rankin_scale_for_admission_id, c.rankin_scale_on_disposal_id, c.is_finance_type_control, c.create_date, c.ticket_vmp, c.ticket_vmp_date, c.narcotic_substance, c.where_from_delivered, c.time_gone_id, c.repeat_count_id, c.care_providing_form_id, c.drunkenness_type_id, c.init_goal_id, c.result_id, c.prehospital_stage_defect_id, c.hsp_canal_id, c.severity_level_id, sg.name, pat_ind.birth_dt, pat_ind.id, pat_ind.surname, pat_ind.name, pat_ind.patr_name, pat_gender.name, r.id, r.order_number, r.referral_date, r.referral_type_id, r.ref_doctor_id, r.ref_organization_code, r.ref_doctor_code, r.proposed_date, r.bed_profile_id, r.department_id, r.profile_id, ref_org.id, ref_org.short_name, ref_org.full_name, ref_dep.id, ref_dep.name, ref_diag.id, ref_diag.code, ref_diag.name, ref_type.name, ref_type.code, admission_reason.id, admission_reason.name
  • Join Filter: (admission_reason.id = c.admission_reason_id)
  • Rows Removed by Join Filter: 15
  • Buffers: shared hit=29
42. 0.002 0.259 ↑ 49,178,088.0 1 1

Nested Loop Left Join (cost=2.43..97,763,978.67 rows=49,178,088 width=752) (actual time=0.259..0.259 rows=1 loops=1)

  • Output: c.patient_id, c.id, c.uid, c.funding_id, c.who_delivered_code, c.who_delivered_team_number, c.closing_step_id, c.transporting_type_id, c.care_level_id, c.payment_method_id, c.care_regimen_id, c.clinic_id, c.rankin_scale_for_admission_id, c.rankin_scale_on_disposal_id, c.is_finance_type_control, c.create_date, c.ticket_vmp, c.ticket_vmp_date, c.narcotic_substance, c.where_from_delivered, c.admission_reason_id, c.time_gone_id, c.repeat_count_id, c.care_providing_form_id, c.drunkenness_type_id, c.init_goal_id, c.result_id, c.prehospital_stage_defect_id, c.hsp_canal_id, c.severity_level_id, sg.name, pat_ind.birth_dt, pat_ind.id, pat_ind.surname, pat_ind.name, pat_ind.patr_name, pat_gender.name, r.id, r.order_number, r.referral_date, r.referral_type_id, r.ref_doctor_id, r.ref_organization_code, r.ref_doctor_code, r.proposed_date, r.bed_profile_id, r.department_id, r.profile_id, ref_org.id, ref_org.short_name, ref_org.full_name, ref_dep.id, ref_dep.name, ref_diag.id, ref_diag.code, ref_diag.name, ref_type.name, ref_type.code
  • Buffers: shared hit=28
43. 0.001 0.257 ↑ 49,178,088.0 1 1

Nested Loop Left Join (cost=2.29..89,649,356.52 rows=49,178,088 width=672) (actual time=0.257..0.257 rows=1 loops=1)

  • Output: c.patient_id, c.id, c.uid, c.funding_id, c.who_delivered_code, c.who_delivered_team_number, c.closing_step_id, c.transporting_type_id, c.care_level_id, c.payment_method_id, c.care_regimen_id, c.clinic_id, c.rankin_scale_for_admission_id, c.rankin_scale_on_disposal_id, c.is_finance_type_control, c.create_date, c.ticket_vmp, c.ticket_vmp_date, c.narcotic_substance, c.where_from_delivered, c.admission_reason_id, c.time_gone_id, c.repeat_count_id, c.care_providing_form_id, c.drunkenness_type_id, c.init_goal_id, c.result_id, c.prehospital_stage_defect_id, c.hsp_canal_id, c.severity_level_id, sg.name, pat_ind.birth_dt, pat_ind.id, pat_ind.surname, pat_ind.name, pat_ind.patr_name, pat_gender.name, r.id, r.order_number, r.referral_date, r.referral_type_id, r.ref_doctor_id, r.ref_organization_code, r.ref_doctor_code, r.proposed_date, r.bed_profile_id, r.department_id, r.profile_id, ref_org.id, ref_org.short_name, ref_org.full_name, ref_dep.id, ref_dep.name, ref_diag.id, ref_diag.code, ref_diag.name
  • Buffers: shared hit=28
44. 0.002 0.255 ↑ 49,178,088.0 1 1

Nested Loop Left Join (cost=2.00..74,249,123.16 rows=49,178,088 width=584) (actual time=0.255..0.255 rows=1 loops=1)

  • Output: c.patient_id, c.id, c.uid, c.funding_id, c.who_delivered_code, c.who_delivered_team_number, c.closing_step_id, c.transporting_type_id, c.care_level_id, c.payment_method_id, c.care_regimen_id, c.clinic_id, c.rankin_scale_for_admission_id, c.rankin_scale_on_disposal_id, c.is_finance_type_control, c.create_date, c.ticket_vmp, c.ticket_vmp_date, c.narcotic_substance, c.where_from_delivered, c.admission_reason_id, c.time_gone_id, c.repeat_count_id, c.care_providing_form_id, c.drunkenness_type_id, c.init_goal_id, c.result_id, c.prehospital_stage_defect_id, c.hsp_canal_id, c.severity_level_id, sg.name, pat_ind.birth_dt, pat_ind.id, pat_ind.surname, pat_ind.name, pat_ind.patr_name, pat_gender.name, r.id, r.order_number, r.referral_date, r.referral_type_id, r.ref_doctor_id, r.ref_organization_code, r.ref_doctor_code, r.proposed_date, r.bed_profile_id, r.department_id, r.profile_id, r.diagnosis_id, ref_org.id, ref_org.short_name, ref_org.full_name, ref_dep.id, ref_dep.name
  • Buffers: shared hit=28
45. 0.000 0.253 ↑ 49,178,088.0 1 1

Nested Loop Left Join (cost=1.71..58,718,419.45 rows=49,178,088 width=541) (actual time=0.253..0.253 rows=1 loops=1)

  • Output: c.patient_id, c.id, c.uid, c.funding_id, c.who_delivered_code, c.who_delivered_team_number, c.closing_step_id, c.transporting_type_id, c.care_level_id, c.payment_method_id, c.care_regimen_id, c.clinic_id, c.rankin_scale_for_admission_id, c.rankin_scale_on_disposal_id, c.is_finance_type_control, c.create_date, c.ticket_vmp, c.ticket_vmp_date, c.narcotic_substance, c.where_from_delivered, c.admission_reason_id, c.time_gone_id, c.repeat_count_id, c.care_providing_form_id, c.drunkenness_type_id, c.init_goal_id, c.result_id, c.prehospital_stage_defect_id, c.hsp_canal_id, c.severity_level_id, sg.name, pat_ind.birth_dt, pat_ind.id, pat_ind.surname, pat_ind.name, pat_ind.patr_name, pat_gender.name, r.id, r.order_number, r.referral_date, r.referral_type_id, r.ref_doctor_id, r.ref_organization_code, r.ref_doctor_code, r.proposed_date, r.bed_profile_id, r.department_id, r.profile_id, r.ref_department_id, r.diagnosis_id, ref_org.id, ref_org.short_name, ref_org.full_name
  • Buffers: shared hit=28
46. 0.002 0.252 ↑ 49,178,088.0 1 1

Nested Loop Left Join (cost=1.43..43,192,785.30 rows=49,178,088 width=432) (actual time=0.252..0.252 rows=1 loops=1)

  • Output: c.patient_id, c.id, c.uid, c.funding_id, c.who_delivered_code, c.who_delivered_team_number, c.closing_step_id, c.transporting_type_id, c.care_level_id, c.payment_method_id, c.care_regimen_id, c.clinic_id, c.rankin_scale_for_admission_id, c.rankin_scale_on_disposal_id, c.is_finance_type_control, c.create_date, c.ticket_vmp, c.ticket_vmp_date, c.narcotic_substance, c.where_from_delivered, c.admission_reason_id, c.time_gone_id, c.repeat_count_id, c.care_providing_form_id, c.drunkenness_type_id, c.init_goal_id, c.result_id, c.prehospital_stage_defect_id, c.hsp_canal_id, c.severity_level_id, sg.name, pat_ind.birth_dt, pat_ind.id, pat_ind.surname, pat_ind.name, pat_ind.patr_name, pat_gender.name, r.id, r.order_number, r.referral_date, r.referral_type_id, r.ref_doctor_id, r.ref_organization_code, r.ref_doctor_code, r.proposed_date, r.bed_profile_id, r.department_id, r.profile_id, r.ref_organization_id, r.ref_department_id, r.diagnosis_id
  • Buffers: shared hit=28
47. 0.012 0.249 ↑ 49,178,088.0 1 1

Nested Loop (cost=1.00..20,454,494.04 rows=49,178,088 width=370) (actual time=0.249..0.249 rows=1 loops=1)

  • Output: c.patient_id, c.id, c.uid, c.funding_id, c.who_delivered_code, c.who_delivered_team_number, c.closing_step_id, c.transporting_type_id, c.care_level_id, c.payment_method_id, c.care_regimen_id, c.clinic_id, c.rankin_scale_for_admission_id, c.rankin_scale_on_disposal_id, c.is_finance_type_control, c.create_date, c.ticket_vmp, c.ticket_vmp_date, c.narcotic_substance, c.where_from_delivered, c.referral_id, c.admission_reason_id, c.time_gone_id, c.repeat_count_id, c.care_providing_form_id, c.drunkenness_type_id, c.init_goal_id, c.result_id, c.prehospital_stage_defect_id, c.hsp_canal_id, c.severity_level_id, sg.name, pat_ind.birth_dt, pat_ind.id, pat_ind.surname, pat_ind.name, pat_ind.patr_name, pat_gender.name
  • Join Filter: (pat.id = c.patient_id)
  • Buffers: shared hit=28
48. 0.006 0.165 ↑ 1,967,945.3 3 1

Nested Loop Left Join (cost=0.43..6,184,569.17 rows=5,903,836 width=181) (actual time=0.078..0.165 rows=3 loops=1)

  • Output: pat.id, sg.name, pat_ind.birth_dt, pat_ind.id, pat_ind.surname, pat_ind.name, pat_ind.patr_name, pat_gender.name
  • Join Filter: (pat_gender.id = pat_ind.gender_id)
  • Rows Removed by Join Filter: 4
  • Buffers: shared hit=15
49. 0.017 0.117 ↑ 1,967,945.3 3 1

Nested Loop Left Join (cost=0.43..5,918,895.51 rows=5,903,836 width=165) (actual time=0.068..0.117 rows=3 loops=1)

  • Output: pat.id, sg.name, pat_ind.birth_dt, pat_ind.id, pat_ind.surname, pat_ind.name, pat_ind.patr_name, pat_ind.gender_id
  • Join Filter: (sg.id = pat.social_group_id)
  • Rows Removed by Join Filter: 68
  • Buffers: shared hit=14
50. 0.008 0.073 ↑ 1,967,945.3 3 1

Nested Loop (cost=0.43..3,882,070.80 rows=5,903,836 width=67) (actual time=0.036..0.073 rows=3 loops=1)

  • Output: pat.id, pat.social_group_id, pat_ind.birth_dt, pat_ind.id, pat_ind.surname, pat_ind.name, pat_ind.patr_name, pat_ind.gender_id
  • Buffers: shared hit=13
51. 0.008 0.008 ↑ 2,314,746.7 3 1

Seq Scan on public.pim_individual pat_ind (cost=0.00..337,664.40 rows=6,944,240 width=59) (actual time=0.008..0.008 rows=3 loops=1)

  • Output: pat_ind.id, pat_ind.birth_dt, pat_ind.death_dt, pat_ind.has_citizenship, pat_ind.name, pat_ind.patr_name, pat_ind.surname, pat_ind.gender_id, pat_ind.nationality_id, pat_ind.list_identity_doc, pat_ind.list_oms_doc, pat_ind.list_job_org, pat_ind.list_reg_name, pat_ind.list_snils, pat_ind.list_uid, pat_ind.aud_who, pat_ind.aud_when, pat_ind.aud_source, pat_ind.aud_who_create, pat_ind.aud_when_create, pat_ind.aud_source_create, pat_ind.birth_place, pat_ind.age_year, pat_ind.age_month, pat_ind.age_day, pat_ind.list_main_contact
  • Buffers: shared hit=1
52. 0.057 0.057 ↑ 1.0 1 3

Index Scan using pci_patient_pkey on public.pci_patient pat (cost=0.43..0.50 rows=1 width=8) (actual time=0.019..0.019 rows=1 loops=3)

  • Output: pat.id, pat.created_dt, pat.note, pat.vip, pat.rh_blood_group_id, pat.ethnic_group_id, pat.social_group_id, pat.death_src_inf_id, pat.empl_state_death_id, pat.unidentified_dt, pat.newborn_number, pat.education_type_id, pat.birthweight, pat.aud_who, pat.aud_when, pat.aud_source, pat.aud_who_create, pat.aud_when_create, pat.aud_source_create, pat.employee_reg_death_position_id, pat.last_fluorography_date
  • Index Cond: (pat.id = pat_ind.id)
  • Buffers: shared hit=12
53. 0.016 0.027 ↑ 1.0 23 3

Materialize (cost=0.00..1.34 rows=23 width=106) (actual time=0.003..0.009 rows=23 loops=3)

  • Output: sg.name, sg.id
  • Buffers: shared hit=1
54. 0.011 0.011 ↑ 1.0 23 1

Seq Scan on public.md_soc_group sg (cost=0.00..1.23 rows=23 width=106) (actual time=0.003..0.011 rows=23 loops=1)

  • Output: sg.name, sg.id
  • Buffers: shared hit=1
55. 0.036 0.042 ↑ 1.5 2 3

Materialize (cost=0.00..1.04 rows=3 width=24) (actual time=0.002..0.014 rows=2 loops=3)

  • Output: pat_gender.name, pat_gender.id
  • Buffers: shared hit=1
56. 0.006 0.006 ↑ 1.0 3 1

Seq Scan on public.pim_gender pat_gender (cost=0.00..1.03 rows=3 width=24) (actual time=0.004..0.006 rows=3 loops=1)

  • Output: pat_gender.name, pat_gender.id
  • Buffers: shared hit=1
57. 0.072 0.072 ↓ 0.0 0 3

Index Scan using mc_case_patient_ix on public.mc_case c (cost=0.56..1.98 rows=35 width=193) (actual time=0.024..0.024 rows=0 loops=3)

  • Output: c.id, c.create_date, c.emergency_team_code, c.note, c.plan_case_duration, c.plan_hosp_date, c.uid, c.who_delivered, c.who_delivered_code, c.who_delivered_team_number, c.admission_reason_id, c.admission_state_id, c.admission_type_id, c.care_level_id, c.case_type_id, c.clinic_id, c.main_contract_id, c.drunkenness_type_id, c.funding_id, c.init_goal_id, c.init_type_id, c.main_diagnos_id, c.result_id, c.patient_id, c.referral_id, c.care_regimen_id, c.repeat_count_id, c.soc_group_id, c.state_id, c.time_gone_id, c.transporting_type_id, c.referral_resulting_id, c.payment_method_id, c.complexity_level_id, c.deviation_reason_id, c.open_date, c.closing_step_id, c.provision_condition_id, c.care_providing_form_id, c.injury_type_id, c.uid_old, c.close_date, c.open_time, c.rankin_scale_for_admission_id, c.rankin_scale_on_disposal_id, c.notes_to_work, c.aud_who, c.aud_when, c.aud_source, c.aud_who_create, c.aud_when_create, c.aud_source_create, c.hsp_canal_id, c.prehospital_stage_defect_id, c.mark, c.is_need_sicklist, c.narcotic_substance, c.where_from_delivered, c.severity_level_id, c.is_social_significant, c.death_reason, c.is_finance_type_control, c.is_control_case_init_goal, c.ticket_vmp, c.ticket_vmp_date, c.planned_hospitalization_date, c.external_reason_mkb_id
  • Index Cond: (c.patient_id = pat_ind.id)
  • Buffers: shared hit=13
58. 0.001 0.001 ↓ 0.0 0 1

Index Scan using md_referral_pk on public.md_referral r (cost=0.43..0.45 rows=1 width=66) (actual time=0.001..0.001 rows=0 loops=1)

  • Output: r.id, r.diagnosis_comment, r.is_urgent, r.order_number, r.referral_comment, r.referral_date, r.diagnosis_id, r.ref_doctor_id, r.funding_id, r.ref_organization_id, r.patient_id, r.prescription_id, r.recv_organization_id, r.recv_doctor_id, r.service_pat_id, r.referral_type_id, r.department_id, r.note, r.step_id, r.service_id, r.goal_id, r.recv_res_group_id, r.date_cancel, r.cancel_reason_id, r.cancel_source_id, r.ref_department_id, r.comment, r.status_id, r.cancel_reason_detail, r.cancel_source_org, r.cancel_source_dep, r.aud_who, r.aud_when, r.aud_source, r.aud_who_create, r.aud_when_create, r.aud_source_create, r.clinical_form_id, r.localization_id, r.complication_id, r.recv_regimen_id, r.ref_organization_role_id, r.case_id, r.receiving_speciality_id, r.is_operation_required, r.ref_organization_code, r.ref_doctor_code, r.ref_status_id, r.send_date, r.vmp_profile_id, r.vmp_kind_id, r.profile_id, r.bed_profile_id, r.proposed_date
  • Index Cond: (r.id = c.referral_id)
59. 0.001 0.001 ↓ 0.0 0 1

Index Scan using pim_organization_pk on public.pim_organization ref_org (cost=0.29..0.31 rows=1 width=113) (actual time=0.001..0.001 rows=0 loops=1)

  • Output: ref_org.id, ref_org.short_name, ref_org.full_name
  • Index Cond: (ref_org.id = r.ref_organization_id)
60. 0.000 0.000 ↓ 0.0 0 1

Index Scan using pim_department_pk on public.pim_department ref_dep (cost=0.29..0.31 rows=1 width=47) (actual time=0.000..0.000 rows=0 loops=1)

  • Output: ref_dep.id, ref_dep.is_available_diagnosis, ref_dep.code, ref_dep.from_dt, ref_dep.name, ref_dep.to_dt, ref_dep.accounting_center_id, ref_dep.type_id, ref_dep.funding_id, ref_dep.org_id, ref_dep.parent_id, ref_dep.sphere_id, ref_dep.is_payment, ref_dep.unit_id, ref_dep.lpu_1, ref_dep.kind_id, ref_dep.e_code, ref_dep.scope_id, ref_dep.aud_who, ref_dep.aud_when, ref_dep.aud_source, ref_dep.aud_who_create, ref_dep.aud_when_create, ref_dep.aud_source_create, ref_dep.is_separate, ref_dep.is_social_significant, ref_dep.age_group_id, ref_dep.is_branch_type, ref_dep.visits_per_shift, ref_dep.departures_per_shift, ref_dep.visits_per_day, ref_dep.necropsies_per_day, ref_dep.clinical_trials_per_shift, ref_dep.brigades_amount, ref_dep.ose, ref_dep.ose_reject, ref_dep.at_home, ref_dep.longitude, ref_dep.latitude, ref_dep.amb_reception_exists
  • Index Cond: (ref_dep.id = r.ref_department_id)
61. 0.001 0.001 ↓ 0.0 0 1

Index Scan using md_diagnosis_pk on public.md_diagnosis ref_diag (cost=0.29..0.30 rows=1 width=92) (actual time=0.001..0.001 rows=0 loops=1)

  • Output: ref_diag.id, ref_diag.code, ref_diag.name, ref_diag.parent_id, ref_diag.is_injury, ref_diag.level, ref_diag.is_leaf, ref_diag.e_code, ref_diag.oms, ref_diag.stomat, ref_diag.aud_who, ref_diag.aud_when, ref_diag.aud_source, ref_diag.aud_who_create, ref_diag.aud_when_create, ref_diag.aud_source_create, ref_diag.from_dt, ref_diag.to_dt
  • Index Cond: (ref_diag.id = r.diagnosis_id)
62. 0.000 0.000 ↓ 0.0 0 1

Index Scan using md_referral_type_pk on public.md_referral_type ref_type (cost=0.14..0.16 rows=1 width=84) (actual time=0.000..0.000 rows=0 loops=1)

  • Output: ref_type.id, ref_type.code, ref_type.name, ref_type.scope_id, ref_type.e_code, ref_type.hsp_rsv_mark, ref_type.aud_who, ref_type.aud_when, ref_type.aud_source, ref_type.aud_who_create, ref_type.aud_when_create, ref_type.aud_source_create, ref_type.from_dt, ref_type.to_dt, ref_type.app_code, ref_type.is_laboratory, ref_type.is_vk
  • Index Cond: (r.referral_type_id = ref_type.id)
63. 0.014 0.023 ↑ 1.0 15 1

Materialize (cost=0.00..1.22 rows=15 width=71) (actual time=0.009..0.023 rows=15 loops=1)

  • Output: admission_reason.id, admission_reason.name
  • Buffers: shared hit=1
64. 0.009 0.009 ↑ 1.0 15 1

Seq Scan on public.mc_admission_reason admission_reason (cost=0.00..1.15 rows=15 width=71) (actual time=0.005..0.009 rows=15 loops=1)

  • Output: admission_reason.id, admission_reason.name
  • Buffers: shared hit=1
65. 0.006 0.014 ↑ 1.0 4 1

Materialize (cost=0.00..1.06 rows=4 width=31) (actual time=0.007..0.014 rows=4 loops=1)

  • Output: time_gone.id, time_gone.name
  • Buffers: shared hit=1
66. 0.008 0.008 ↑ 1.0 4 1

Seq Scan on public.mc_time_gone time_gone (cost=0.00..1.04 rows=4 width=31) (actual time=0.004..0.008 rows=4 loops=1)

  • Output: time_gone.id, time_gone.name
  • Buffers: shared hit=1
67. 0.005 0.009 ↑ 2.0 1 1

Materialize (cost=0.00..1.03 rows=2 width=21) (actual time=0.009..0.009 rows=1 loops=1)

  • Output: repeat_count.id, repeat_count.name
  • Buffers: shared hit=1
68. 0.004 0.004 ↑ 2.0 1 1

Seq Scan on public.mc_repeat_count repeat_count (cost=0.00..1.02 rows=2 width=21) (actual time=0.004..0.004 rows=1 loops=1)

  • Output: repeat_count.id, repeat_count.name
  • Buffers: shared hit=1
69. 0.004 0.010 ↑ 1.0 3 1

Materialize (cost=0.00..1.04 rows=3 width=23) (actual time=0.008..0.010 rows=3 loops=1)

  • Output: md_care_providing_form.id, md_care_providing_form.name
  • Buffers: shared hit=1
70. 0.006 0.006 ↑ 1.0 3 1

Seq Scan on public.md_care_providing_form (cost=0.00..1.03 rows=3 width=23) (actual time=0.004..0.006 rows=3 loops=1)

  • Output: md_care_providing_form.id, md_care_providing_form.name
  • Buffers: shared hit=1
71. 0.004 0.014 ↑ 1.0 9 1

Materialize (cost=0.00..1.14 rows=9 width=57) (actual time=0.006..0.014 rows=9 loops=1)

  • Output: drunkenness_type.id, drunkenness_type.name
  • Buffers: shared hit=1
72. 0.010 0.010 ↑ 1.0 9 1

Seq Scan on public.mc_drunkenness_type drunkenness_type (cost=0.00..1.09 rows=9 width=57) (actual time=0.004..0.010 rows=9 loops=1)

  • Output: drunkenness_type.id, drunkenness_type.name
  • Buffers: shared hit=1
73. 0.012 0.012 ↑ 1.0 1 1

Index Scan using mc_case_init_goal_pk on public.mc_case_init_goal (cost=0.14..0.16 rows=1 width=155) (actual time=0.012..0.012 rows=1 loops=1)

  • Output: mc_case_init_goal.id, mc_case_init_goal.code, mc_case_init_goal.name, mc_case_init_goal.visit_type_id, mc_case_init_goal.e_code, mc_case_init_goal.aud_who, mc_case_init_goal.aud_when, mc_case_init_goal.aud_source, mc_case_init_goal.aud_who_create, mc_case_init_goal.aud_when_create, mc_case_init_goal.aud_source_create, mc_case_init_goal.from_dt, mc_case_init_goal.to_dt
  • Index Cond: (mc_case_init_goal.id = c.init_goal_id)
  • Buffers: shared hit=2
74. 0.001 0.001 ↓ 0.0 0 1

Index Only Scan using mc_med_case_result_pk on public.mc_med_case_result case_result (cost=0.43..0.45 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=1)

  • Output: case_result.id
  • Index Cond: (case_result.id = c.result_id)
  • Heap Fetches: 0
75. 0.003 0.009 ↑ 1.0 4 1

Materialize (cost=0.00..1.06 rows=4 width=4) (actual time=0.006..0.009 rows=4 loops=1)

  • Output: psd.id
  • Buffers: shared hit=1
76. 0.006 0.006 ↑ 1.0 4 1

Seq Scan on public.mc_prehospital_stage_defect psd (cost=0.00..1.04 rows=4 width=4) (actual time=0.004..0.006 rows=4 loops=1)

  • Output: psd.id
  • Buffers: shared hit=1
77. 0.000 0.000 ↓ 0.0 0 1

Index Scan using mc_hsp_canal_pkey on public.mc_hsp_canal hc (cost=0.14..0.16 rows=1 width=520) (actual time=0.000..0.000 rows=0 loops=1)

  • Output: hc.id, hc.code, hc.name, hc.e_code, hc.aud_who, hc.aud_when, hc.aud_source, hc.aud_who_create, hc.aud_when_create, hc.aud_source_create
  • Index Cond: (hc.id = c.hsp_canal_id)
78. 0.015 0.015 ↓ 0.0 0 1

Index Scan using md_sicklist_case_id_idx on public.md_sicklist sl (cost=0.42..0.52 rows=3 width=8) (actual time=0.015..0.015 rows=0 loops=1)

  • Output: sl.id, sl.code, sl.disability_from_dt, sl.is_disability_group_changed, sl.disability_to_dt, sl.is_early_pregnancy_register, sl.mse_examination_dt, sl.family_member_1_age, sl.family_member_1_age_month, sl.family_member_1_name, sl.family_member_2_age, sl.family_member_2_age_month, sl.family_member_2_name, sl.hospital_from_dt, sl.hospital_to_dt, sl.issue_dt, sl.ready_to_work_dt, sl.ready_to_work_other_dt, sl.mse_referral_dt, sl.regimen_violation_dt, sl.mse_register_dt, sl.sanatorium_ogrn_code, sl.voucher_code, sl.clinic_id, sl.disability_reason_id, sl.disability_reason_edited_id, sl.disability_reason_ext_id, sl.family_member_1_relation_id, sl.family_member_2_relation_id, sl.case_id, sl.parent_id, sl.patient_id, sl.ready_to_work_other_id, sl.regimen_violation_id, sl.regimen_violation_doctor_id, sl.state_id, sl.type_id, sl.workplace_id, sl.workplace_type_id, sl.transfer_to_o_clinic, sl.mse_org_id, sl.on_placement_service, sl.name, sl.patr_name, sl.surname, sl.workplace_print, sl.initial_diagnosis_id, sl.final_diagnosis_id, sl.aud_who, sl.aud_when, sl.aud_source, sl.aud_who_create, sl.aud_when_create, sl.aud_source_create, sl.transfer_from_clinic, sl.parent_print
  • Index Cond: (sl.case_id = c.id)
  • Filter: ((sl.workplace_type_id = 1) AND (sl.state_id = 3) AND (sl.type_id = 1))
  • Buffers: shared hit=3
79. 0.009 0.012 ↑ 1.0 5 1

Materialize (cost=0.00..1.07 rows=5 width=30) (actual time=0.008..0.012 rows=5 loops=1)

  • Output: msl.id, msl.name
  • Buffers: shared hit=1
80. 0.003 0.003 ↑ 1.0 5 1

Seq Scan on public.mc_severity_level msl (cost=0.00..1.05 rows=5 width=30) (actual time=0.003..0.003 rows=5 loops=1)

  • Output: msl.id, msl.name
  • Buffers: shared hit=1
81. 0.001 0.001 ↓ 0.0 0 1

Index Scan using md_profile_pk on public.md_profile mp (cost=0.14..0.16 rows=1 width=90) (actual time=0.001..0.001 rows=0 loops=1)

  • Output: mp.id, mp.code, mp.genitive_name, mp.name, mp.e_code, mp.aud_who, mp.aud_when, mp.aud_source, mp.aud_who_create, mp.aud_when_create, mp.aud_source_create, mp.from_dt, mp.to_dt
  • Index Cond: (mp.id = r.profile_id)
82. 0.001 0.001 ↓ 0.0 0 1

Index Scan using pk_md_bed_profile on public.md_bed_profile mbp (cost=0.27..0.29 rows=1 width=97) (actual time=0.001..0.001 rows=0 loops=1)

  • Output: mbp.id, mbp.code, mbp.name, mbp.e_code, mbp.parent_id, mbp.aud_who, mbp.aud_when, mbp.aud_source, mbp.aud_who_create, mbp.aud_when_create, mbp.aud_source_create, mbp.from_dt, mbp.to_dt
  • Index Cond: (mbp.id = r.bed_profile_id)
83. 0.003 0.005 ↑ 8.0 1 1

Materialize (cost=0.00..1.12 rows=8 width=4) (actual time=0.005..0.005 rows=1 loops=1)

  • Output: mcr.id
  • Buffers: shared hit=1
84. 0.002 0.002 ↑ 8.0 1 1

Seq Scan on public.mc_care_regimen mcr (cost=0.00..1.08 rows=8 width=4) (actual time=0.002..0.002 rows=1 loops=1)

  • Output: mcr.id
  • Buffers: shared hit=1
85. 0.019 0.019 ↑ 1.0 1 1

Index Scan using mc_step_pk on public.mc_step mcs (cost=0.57..0.72 rows=1 width=16) (actual time=0.019..0.019 rows=1 loops=1)

  • Output: mcs.id, mcs.admission_date, mcs.admission_time, mcs.death_date, mcs.death_time, mcs.outcome_date, mcs.outcome_time, mcs.death_employee_id, mcs.main_diagnosis_id, mcs.case_id, mcs.outcome_id, mcs.outcome_clinic_id, mcs.outcome_regimen_id, mcs.regimen_id, mcs.res_group_id, mcs.result_id, mcs.reason_id, mcs.profile_id, mcs.mes_id, mcs.mes_quality_criterion_id, mcs.is_continue, mcs.is_continue_editable, mcs.standard_id, mcs.csg_id, mcs.vmp_type_id, mcs.vmp_method_id, mcs.deviation_reason_id, mcs.aud_who, mcs.aud_when, mcs.aud_source, mcs.aud_who_create, mcs.aud_when_create, mcs.aud_source_create, mcs._clinic_id, mcs._patient_id, mcs.planned_date_closing_case, mcs.hsp_bed_profile_id, mcs.gestational_age, mcs.onko_stage
  • Index Cond: (mcs.id = c.closing_step_id)
  • Buffers: shared hit=5
86. 0.000 0.000 ↓ 0.0 0 1

Index Scan using mc_diagnosis_pk on public.mc_diagnosis (cost=0.57..0.70 rows=1 width=8) (actual time=0.000..0.000 rows=0 loops=1)

  • Output: mc_diagnosis.id, mc_diagnosis.diagnos_id
  • Index Cond: (mc_diagnosis.id = mcs.main_diagnosis_id)
87. 0.000 0.000 ↓ 0.0 0 1

Index Scan using md_diagnosis_pk on public.md_diagnosis main_diag (cost=0.29..0.30 rows=1 width=9) (actual time=0.000..0.000 rows=0 loops=1)

  • Output: main_diag.id, main_diag.code, main_diag.name, main_diag.parent_id, main_diag.is_injury, main_diag.level, main_diag.is_leaf, main_diag.e_code, main_diag.oms, main_diag.stomat, main_diag.aud_who, main_diag.aud_when, main_diag.aud_source, main_diag.aud_who_create, main_diag.aud_when_create, main_diag.aud_source_create, main_diag.from_dt, main_diag.to_dt
  • Index Cond: (main_diag.id = mc_diagnosis.diagnos_id)
88.          

SubPlan (forNested Loop Left Join)

89. 0.001 0.077 ↓ 0.0 0 1

Limit (cost=14.59..14.60 rows=1 width=88) (actual time=0.077..0.077 rows=0 loops=1)

  • Output: (((((dt.name)::text || COALESCE((', Серия: '::text || (doc.series)::text), ''::text)) || ', Номер: '::text) || (doc.number)::text)), dt.priority
  • Buffers: shared hit=4
90. 0.014 0.076 ↓ 0.0 0 1

Sort (cost=14.59..14.60 rows=1 width=88) (actual time=0.076..0.076 rows=0 loops=1)

  • Output: (((((dt.name)::text || COALESCE((', Серия: '::text || (doc.series)::text), ''::text)) || ', Номер: '::text) || (doc.number)::text)), dt.priority
  • Sort Key: dt.priority
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=4
91. 0.007 0.062 ↓ 0.0 0 1

Nested Loop (cost=12.17..14.58 rows=1 width=88) (actual time=0.062..0.062 rows=0 loops=1)

  • Output: ((((dt.name)::text || COALESCE((', Серия: '::text || (doc.series)::text), ''::text)) || ', Номер: '::text) || (doc.number)::text), dt.priority
  • Join Filter: (doc.type_id = dt.id)
  • Buffers: shared hit=4
92. 0.012 0.055 ↓ 0.0 0 1

Hash Join (cost=12.03..13.76 rows=1 width=22) (actual time=0.055..0.055 rows=0 loops=1)

  • Output: doc.series, doc.number, doc.type_id, dtc.type_id
  • Hash Cond: (dtc.type_id = doc.type_id)
  • Buffers: shared hit=4
93. 0.022 0.022 ↑ 25.0 1 1

Seq Scan on public.pim_doc_type_category dtc (cost=0.00..1.60 rows=25 width=4) (actual time=0.022..0.022 rows=1 loops=1)

  • Output: dtc.type_id, dtc.category_id, dtc.aud_who, dtc.aud_when, dtc.aud_source, dtc.aud_who_create, dtc.aud_when_create, dtc.aud_source_create
  • Filter: (dtc.category_id = 1)
  • Buffers: shared hit=1
94. 0.001 0.021 ↓ 0.0 0 1

Hash (cost=12.00..12.00 rows=2 width=18) (actual time=0.021..0.021 rows=0 loops=1)

  • Output: doc.series, doc.number, doc.type_id
  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
  • Buffers: shared hit=3
95. 0.020 0.020 ↓ 0.0 0 1

Index Scan using pim_individual_doc_indiv_id_idx on public.pim_individual_doc doc (cost=0.43..12.00 rows=2 width=18) (actual time=0.020..0.020 rows=0 loops=1)

  • Output: doc.series, doc.number, doc.type_id
  • Index Cond: (doc.indiv_id = pat_ind.id)
  • Filter: (doc.is_active IS TRUE)
  • Buffers: shared hit=3
96. 0.000 0.000 ↓ 0.0 0

Index Scan using pim_doc_type_pk on public.pim_doc_type dt (cost=0.14..0.80 rows=1 width=78) (never executed)

  • Output: dt.id, dt.code, dt.is_contract_permitted, dt.from_dt, dt.name, dt.note, dt.occurrence, dt.priority, dt.to_dt, dt.party_type_id, dt.code_type_id, dt.e_code, dt.aud_who, dt.aud_when, dt.aud_source, dt.aud_who_create, dt.aud_when_create, dt.aud_source_create, dt.is_series_hidden, dt.is_number_hidden, dt.series_format, dt.series_message_pattern, dt.number_format, dt.number_message_pattern, dt.scope_id
  • Index Cond: (dt.id = dtc.type_id)
97. 0.001 0.031 ↓ 0.0 0 1

Limit (cost=23.78..23.78 rows=1 width=60) (actual time=0.031..0.031 rows=0 loops=1)

  • Output: ((((COALESCE(('Серия: '::text || (doc_1.series)::text), ''::text) || ', Номер: '::text) || (doc_1.number)::text) || COALESCE((', Кем выдан: '::text || (issuer.short_name)::text)))), dt_1.priority
  • Buffers: shared hit=4
98. 0.007 0.030 ↓ 0.0 0 1

Sort (cost=23.78..23.78 rows=1 width=60) (actual time=0.030..0.030 rows=0 loops=1)

  • Output: ((((COALESCE(('Серия: '::text || (doc_1.series)::text), ''::text) || ', Номер: '::text) || (doc_1.number)::text) || COALESCE((', Кем выдан: '::text || (issuer.short_name)::text)))), dt_1.priority
  • Sort Key: dt_1.priority
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=4
99. 0.000 0.023 ↓ 0.0 0 1

Nested Loop Left Join (cost=12.46..23.77 rows=1 width=60) (actual time=0.023..0.023 rows=0 loops=1)

  • Output: (((COALESCE(('Серия: '::text || (doc_1.series)::text), ''::text) || ', Номер: '::text) || (doc_1.number)::text) || COALESCE((', Кем выдан: '::text || (issuer.short_name)::text))), dt_1.priority
  • Buffers: shared hit=4
100. 0.004 0.023 ↓ 0.0 0 1

Nested Loop (cost=12.17..15.44 rows=1 width=22) (actual time=0.023..0.023 rows=0 loops=1)

  • Output: doc_1.series, doc_1.number, doc_1.issuer_id, dt_1.priority
  • Buffers: shared hit=4
101. 0.010 0.019 ↓ 0.0 0 1

Hash Join (cost=12.03..14.77 rows=2 width=30) (actual time=0.019..0.019 rows=0 loops=1)

  • Output: doc_1.series, doc_1.number, doc_1.type_id, doc_1.issuer_id, dt_1.priority, dt_1.id
  • Hash Cond: (dt_1.id = doc_1.type_id)
  • Buffers: shared hit=4
102. 0.004 0.004 ↑ 48.0 1 1

Seq Scan on public.pim_doc_type dt_1 (cost=0.00..2.48 rows=48 width=8) (actual time=0.004..0.004 rows=1 loops=1)

  • Output: dt_1.id, dt_1.code, dt_1.is_contract_permitted, dt_1.from_dt, dt_1.name, dt_1.note, dt_1.occurrence, dt_1.priority, dt_1.to_dt, dt_1.party_type_id, dt_1.code_type_id, dt_1.e_code, dt_1.aud_who, dt_1.aud_when, dt_1.aud_source, dt_1.aud_who_create, dt_1.aud_when_create, dt_1.aud_source_create, dt_1.is_series_hidden, dt_1.is_number_hidden, dt_1.series_format, dt_1.series_message_pattern, dt_1.number_format, dt_1.number_message_pattern, dt_1.scope_id
  • Buffers: shared hit=1
103. 0.002 0.005 ↓ 0.0 0 1

Hash (cost=12.00..12.00 rows=2 width=22) (actual time=0.005..0.005 rows=0 loops=1)

  • Output: doc_1.series, doc_1.number, doc_1.type_id, doc_1.issuer_id
  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
  • Buffers: shared hit=3
104. 0.003 0.003 ↓ 0.0 0 1

Index Scan using pim_individual_doc_indiv_id_idx on public.pim_individual_doc doc_1 (cost=0.43..12.00 rows=2 width=22) (actual time=0.003..0.003 rows=0 loops=1)

  • Output: doc_1.series, doc_1.number, doc_1.type_id, doc_1.issuer_id
  • Index Cond: (doc_1.indiv_id = pat_ind.id)
  • Filter: (doc_1.is_active IS TRUE)
  • Buffers: shared hit=3
105. 0.000 0.000 ↓ 0.0 0

Index Only Scan using pim_doc_type_category_pk on public.pim_doc_type_category dtc_1 (cost=0.14..0.33 rows=1 width=4) (never executed)

  • Output: dtc_1.type_id, dtc_1.category_id
  • Index Cond: ((dtc_1.type_id = dt_1.id) AND (dtc_1.category_id = 2))
  • Heap Fetches: 0
106. 0.000 0.000 ↓ 0.0 0

Index Scan using pim_organization_pk on public.pim_organization issuer (cost=0.29..8.30 rows=1 width=46) (never executed)

  • Output: issuer.short_name, issuer.id
  • Index Cond: (issuer.id = doc_1.issuer_id)
107. 0.003 0.019 ↑ 1.0 1 1

Aggregate (cost=9.55..9.56 rows=1 width=38) (actual time=0.019..0.019 rows=1 loops=1)

  • Output: string_agg((bt.name)::text, ', '::text)
  • Buffers: shared hit=3
108. 0.001 0.016 ↓ 0.0 0 1

Nested Loop (cost=0.42..9.55 rows=1 width=38) (actual time=0.016..0.016 rows=0 loops=1)

  • Output: bt.name
  • Join Filter: (b.benefit_type_id = bt.id)
  • Buffers: shared hit=3
109. 0.015 0.015 ↓ 0.0 0 1

Index Scan using pci_benefit_patient_id_idx on public.pci_benefit b (cost=0.42..8.44 rows=1 width=4) (actual time=0.015..0.015 rows=0 loops=1)

  • Output: b.id, b.created_dt, b.disability_degree, b.is_disability_primary, b.doc_issuer, b.doc_issuer_dt, b.doc_name, b.doc_number, b.from_dt, b.note, b.to_dt, b.benefit_def_id, b.benefit_reg_in_id, b.benefit_reg_out_id, b.benefit_type_id, b.diagnos_id, b.disability_type_id, b.patient_id, b.is_confirmed, b.clinic_id, b.aud_who, b.aud_when, b.aud_source, b.aud_who_create, b.aud_when_create, b.aud_source_create, b.department_id
  • Index Cond: (b.patient_id = c.patient_id)
  • Buffers: shared hit=3
110. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.pci_benefit_type bt (cost=0.00..1.05 rows=5 width=42) (never executed)

  • Output: bt.id, bt.code, bt.from_dt, bt.name, bt.note, bt.to_dt, bt.is_available_register, bt.is_available_package, bt.is_required_diagnosis, bt.is_required_disability, bt.e_code, bt.funding_source_type_id, bt.aud_who, bt.aud_when, bt.aud_source, bt.aud_who_create, bt.aud_when_create, bt.aud_source_create
111. 1.291 1.304 ↑ 1.0 1 1

Result (cost=17.00..17.26 rows=1 width=0) (actual time=1.304..1.304 rows=1 loops=1)

  • Output: adr__get_element_as_text($8, '(1,n,1)(2,s,0)(3,s,0)(4,s,0)(5,s,0)(6,s,0)(7,s,0)(8,s,0)(9,s,0)'::text)
  • Buffers: shared hit=13
112.          

Initplan (forResult)

113. 0.001 0.013 ↓ 0.0 0 1

Limit (cost=0.86..17.00 rows=1 width=4) (actual time=0.013..0.013 rows=0 loops=1)

  • Output: pa.addr_id
  • Buffers: shared hit=3
114. 0.000 0.012 ↓ 0.0 0 1

Nested Loop (cost=0.86..17.00 rows=1 width=4) (actual time=0.012..0.012 rows=0 loops=1)

  • Output: pa.addr_id
  • Buffers: shared hit=3
115. 0.012 0.012 ↓ 0.0 0 1

Index Scan using pim_party_address_party_id_idx on public.pim_party_address pa (cost=0.43..8.45 rows=1 width=8) (actual time=0.012..0.012 rows=0 loops=1)

  • Output: pa.id, pa.from_date, pa.note, pa.text_addr, pa.to_date, pa.is_valid, pa.addr_id, pa.party_id, pa.register_type_id, pa.aud_who, pa.aud_when, pa.aud_source, pa.aud_who_create, pa.aud_when_create, pa.aud_source_create
  • Index Cond: (pa.party_id = pat_ind.id)
  • Buffers: shared hit=3
116. 0.000 0.000 ↓ 0.0 0

Index Only Scan using pim_party_addr_to_addr_type_address_type_id_party_address_id_id on public.pim_party_addr_to_addr_type patat (cost=0.43..8.51 rows=4 width=4) (never executed)

  • Output: patat.address_type_id, patat.party_address_id
  • Index Cond: ((patat.address_type_id = 4) AND (patat.party_address_id = pa.id))
  • Heap Fetches: 0
117. 0.679 0.688 ↑ 1.0 1 1

Result (cost=16.91..17.17 rows=1 width=0) (actual time=0.688..0.688 rows=1 loops=1)

  • Output: adr__get_element_as_text($11, '(1,n,1)(2,s,0)(3,s,0)(4,s,0)(5,s,0)(6,s,0)(7,s,0)(8,s,0)(9,s,0)'::text)
  • Buffers: shared hit=13
118.          

Initplan (forResult)

119. 0.001 0.009 ↓ 0.0 0 1

Limit (cost=0.86..16.91 rows=1 width=4) (actual time=0.009..0.009 rows=0 loops=1)

  • Output: pa_1.addr_id
  • Buffers: shared hit=3
120. 0.001 0.008 ↓ 0.0 0 1

Nested Loop (cost=0.86..16.91 rows=1 width=4) (actual time=0.008..0.008 rows=0 loops=1)

  • Output: pa_1.addr_id
  • Buffers: shared hit=3
121. 0.007 0.007 ↓ 0.0 0 1

Index Scan using pim_party_address_party_id_idx on public.pim_party_address pa_1 (cost=0.43..8.45 rows=1 width=8) (actual time=0.007..0.007 rows=0 loops=1)

  • Output: pa_1.id, pa_1.from_date, pa_1.note, pa_1.text_addr, pa_1.to_date, pa_1.is_valid, pa_1.addr_id, pa_1.party_id, pa_1.register_type_id, pa_1.aud_who, pa_1.aud_when, pa_1.aud_source, pa_1.aud_who_create, pa_1.aud_when_create, pa_1.aud_source_create
  • Index Cond: (pa_1.party_id = pat_ind.id)
  • Buffers: shared hit=3
122. 0.000 0.000 ↓ 0.0 0

Index Only Scan using pim_party_addr_to_addr_type_address_type_id_party_address_id_id on public.pim_party_addr_to_addr_type patat_1 (cost=0.43..8.45 rows=1 width=4) (never executed)

  • Output: patat_1.address_type_id, patat_1.party_address_id
  • Index Cond: ((patat_1.address_type_id = 3) AND (patat_1.party_address_id = pa_1.id))
  • Heap Fetches: 0
123. 0.026 0.026 ↑ 1.0 1 1

Seq Scan on public.fin_funding_source_type (cost=0.00..1.14 rows=1 width=32) (actual time=0.025..0.026 rows=1 loops=1)

  • Output: row_to_json(ROW(fin_funding_source_type.id, fin_funding_source_type.name))
  • Filter: (fin_funding_source_type.id = c.funding_id)
  • Rows Removed by Filter: 10
  • Buffers: shared hit=1
124. 0.001 0.007 ↓ 0.0 0 1

Limit (cost=2.30..55.54 rows=1 width=144) (actual time=0.007..0.007 rows=0 loops=1)

  • Output: ((((((((((COALESCE(pim_individual.surname, ''::character varying))::text || ' '::text) || CASE COALESCE("substring"((pim_individual.name)::text, 1, 1), ''::text) WHEN ''::text THEN ''::text ELSE ("substring"((pim_individual.name)::text, 1, 1) || '.'::text) END) || ' '::text) || CASE COALESCE("substring"((pim_individual.patr_name)::text, 1, 1), ''::text) WHEN ''::text THEN ''::text ELSE ("substring"((pim_individual.patr_name)::text, 1, 1) || '.'::text) END) || ', '::text) || (COALESCE(pos.name, (SubPlan 9)))::text) || ', '::text) || (dep.name)::text))
125. 0.001 0.006 ↓ 0.0 0 1

Nested Loop (cost=2.30..55.54 rows=1 width=144) (actual time=0.006..0.006 rows=0 loops=1)

  • Output: (((((((((COALESCE(pim_individual.surname, ''::character varying))::text || ' '::text) || CASE COALESCE("substring"((pim_individual.name)::text, 1, 1), ''::text) WHEN ''::text THEN ''::text ELSE ("substring"((pim_individual.name)::text, 1, 1) || '.'::text) END) || ' '::text) || CASE COALESCE("substring"((pim_individual.patr_name)::text, 1, 1), ''::text) WHEN ''::text THEN ''::text ELSE ("substring"((pim_individual.patr_name)::text, 1, 1) || '.'::text) END) || ', '::text) || (COALESCE(pos.name, (SubPlan 9)))::text) || ', '::text) || (dep.name)::text)
126. 0.000 0.005 ↓ 0.0 0 1

Nested Loop (cost=2.01..46.97 rows=1 width=105) (actual time=0.005..0.005 rows=0 loops=1)

  • Output: pim_individual.surname, pim_individual.name, pim_individual.patr_name, pos.name, pos.speciality_id, pos.department_id
127. 0.001 0.005 ↓ 0.0 0 1

Nested Loop (cost=1.60..38.53 rows=1 width=51) (actual time=0.005..0.005 rows=0 loops=1)

  • Output: pim_employee_position.position_id, pim_individual.surname, pim_individual.name, pim_individual.patr_name
128. 0.000 0.004 ↓ 0.0 0 1

Nested Loop (cost=1.16..33.26 rows=1 width=8) (actual time=0.004..0.004 rows=0 loops=1)

  • Output: pim_employee_position.position_id, pim_employee.individual_id
129. 0.002 0.004 ↓ 0.0 0 1

Nested Loop (cost=0.87..24.95 rows=1 width=8) (actual time=0.004..0.004 rows=0 loops=1)

  • Output: pim_employee_position.employee_id, pim_employee_position.position_id
130. 0.001 0.002 ↓ 0.0 0 1

Nested Loop (cost=0.58..16.63 rows=1 width=12) (actual time=0.002..0.002 rows=0 loops=1)

  • Output: pim_employee_position.id, pim_employee_position.employee_id, pim_employee_position.position_id
131. 0.001 0.001 ↓ 0.0 0 1

Index Only Scan using md_employee_position_pk on public.md_employee_position (cost=0.29..8.31 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=1)

  • Output: md_employee_position.id
  • Index Cond: (md_employee_position.id = r.ref_doctor_id)
  • Heap Fetches: 0
132. 0.000 0.000 ↓ 0.0 0

Index Scan using pim_employee_position_pk on public.pim_employee_position (cost=0.29..8.31 rows=1 width=12) (never executed)

  • Output: pim_employee_position.id, pim_employee_position.dismissal_order_code, pim_employee_position.start_date, pim_employee_position.hiring_order_code, pim_employee_position.rate, pim_employee_position.end_date, pim_employee_position.dismissal_reason_id, pim_employee_position.employee_id, pim_employee_position.employment_type_id, pim_employee_position.hiring_type_id, pim_employee_position.position_id, pim_employee_position.position_type_id, pim_employee_position.unit_id, pim_employee_position.code, pim_employee_position.aud_who, pim_employee_position.aud_when, pim_employee_position.aud_source, pim_employee_position.aud_who_create, pim_employee_position.aud_when_create, pim_employee_position.aud_source_create, pim_employee_position.pref_prescription, pim_employee_position.extra_payment, pim_employee_position.target_training, pim_employee_position.leaving_reason_id
  • Index Cond: (pim_employee_position.id = r.ref_doctor_id)
133. 0.000 0.000 ↓ 0.0 0

Index Only Scan using employee_position_id_unique on public.pim_employee_position_resource (cost=0.29..8.31 rows=1 width=4) (never executed)

  • Output: pim_employee_position_resource.employee_position_id
  • Index Cond: (pim_employee_position_resource.employee_position_id = r.ref_doctor_id)
  • Heap Fetches: 0
134. 0.000 0.000 ↓ 0.0 0

Index Scan using pim_employee_pk on public.pim_employee (cost=0.29..8.31 rows=1 width=8) (never executed)

  • Output: pim_employee.id, pim_employee.note, pim_employee.number, pim_employee.photo, pim_employee.callup_subject_id, pim_employee.individual_id, pim_employee.organization_id, pim_employee.is_dismissed, pim_employee.employment_dt, pim_employee.dismissal_dt, pim_employee.aud_who, pim_employee.aud_when, pim_employee.aud_source, pim_employee.aud_who_create, pim_employee.aud_when_create, pim_employee.aud_source_create, pim_employee.accreditation_id
  • Index Cond: (pim_employee.id = pim_employee_position.employee_id)
135. 0.000 0.000 ↓ 0.0 0

Index Scan using pim_individual_pk on public.pim_individual (cost=0.43..5.26 rows=1 width=51) (never executed)

  • Output: pim_individual.id, pim_individual.birth_dt, pim_individual.death_dt, pim_individual.has_citizenship, pim_individual.name, pim_individual.patr_name, pim_individual.surname, pim_individual.gender_id, pim_individual.nationality_id, pim_individual.list_identity_doc, pim_individual.list_oms_doc, pim_individual.list_job_org, pim_individual.list_reg_name, pim_individual.list_snils, pim_individual.list_uid, pim_individual.aud_who, pim_individual.aud_when, pim_individual.aud_source, pim_individual.aud_who_create, pim_individual.aud_when_create, pim_individual.aud_source_create, pim_individual.birth_place, pim_individual.age_year, pim_individual.age_month, pim_individual.age_day, pim_individual.list_main_contact
  • Index Cond: (pim_individual.id = pim_employee.individual_id)
136. 0.000 0.000 ↓ 0.0 0

Index Scan using pim_position_pk on public.pim_position pos (cost=0.41..8.43 rows=1 width=62) (never executed)

  • Output: pos.id, pos.code, pos.start_date, pos.name, pos.end_date, pos.department_id, pos.organization_id, pos.role_id, pos.speciality_id, pos.rate, pos.aud_who, pos.aud_when, pos.aud_source, pos.aud_who_create, pos.aud_when_create, pos.aud_source_create, pos.pref_prescription, pos.payment_fond, pos.staff_event1, pos.staff_event2
  • Index Cond: (pos.id = pim_employee_position.position_id)
137. 0.000 0.000 ↓ 0.0 0

Index Scan using pim_department_pk on public.pim_department dep (cost=0.29..0.35 rows=1 width=47) (never executed)

  • Output: dep.id, dep.is_available_diagnosis, dep.code, dep.from_dt, dep.name, dep.to_dt, dep.accounting_center_id, dep.type_id, dep.funding_id, dep.org_id, dep.parent_id, dep.sphere_id, dep.is_payment, dep.unit_id, dep.lpu_1, dep.kind_id, dep.e_code, dep.scope_id, dep.aud_who, dep.aud_when, dep.aud_source, dep.aud_who_create, dep.aud_when_create, dep.aud_source_create, dep.is_separate, dep.is_social_significant, dep.age_group_id, dep.is_branch_type, dep.visits_per_shift, dep.departures_per_shift, dep.visits_per_day, dep.necropsies_per_day, dep.clinical_trials_per_shift, dep.brigades_amount, dep.ose, dep.ose_reject, dep.at_home, dep.longitude, dep.latitude, dep.amb_reception_exists
  • Index Cond: (dep.id = pos.department_id)
138.          

SubPlan (forNested Loop)

139. 0.000 0.000 ↓ 0.0 0

Index Scan using pim_speciality_pk on public.pim_speciality (cost=0.14..8.16 rows=1 width=62) (never executed)

  • Output: pim_speciality.name
  • Index Cond: (pim_speciality.id = pos.speciality_id)
140. 0.000 0.052 ↓ 0.0 0 1

Limit (cost=1.00..272.57 rows=1 width=4) (actual time=0.052..0.052 rows=0 loops=1)

  • Output: r_1.id
  • Buffers: shared hit=14
141. 0.002 0.052 ↓ 0.0 0 1

Nested Loop (cost=1.00..272.57 rows=1 width=4) (actual time=0.052..0.052 rows=0 loops=1)

  • Output: r_1.id
  • Buffers: shared hit=14
142. 0.028 0.028 ↑ 13.5 2 1

Index Scan using mc_step_case_ix on public.mc_step s (cost=0.57..44.22 rows=27 width=4) (actual time=0.024..0.028 rows=2 loops=1)

  • Output: s.id, s.admission_date, s.admission_time, s.death_date, s.death_time, s.outcome_date, s.outcome_time, s.death_employee_id, s.main_diagnosis_id, s.case_id, s.outcome_id, s.outcome_clinic_id, s.outcome_regimen_id, s.regimen_id, s.res_group_id, s.result_id, s.reason_id, s.profile_id, s.mes_id, s.mes_quality_criterion_id, s.is_continue, s.is_continue_editable, s.standard_id, s.csg_id, s.vmp_type_id, s.vmp_method_id, s.deviation_reason_id, s.aud_who, s.aud_when, s.aud_source, s.aud_who_create, s.aud_when_create, s.aud_source_create, s._clinic_id, s._patient_id, s.planned_date_closing_case, s.hsp_bed_profile_id, s.gestational_age, s.onko_stage
  • Index Cond: (s.case_id = c.id)
  • Buffers: shared hit=6
143. 0.022 0.022 ↓ 0.0 0 2

Index Scan using hsp_record_pk on public.hsp_record r_1 (cost=0.43..8.45 rows=1 width=4) (actual time=0.011..0.011 rows=0 loops=2)

  • Output: r_1.id, r_1.is_admission_day_counts, r_1.old_is_continue, r_1.department_id, r_1.funding_id, r_1.mes_id, r_1.previous_id, r_1.is_set_diagnosis, r_1.old_is_continue_edit, r_1.is_diag_not_eq, r_1.days_comp_algo_id, r_1.missed_days_amount, r_1.bed_days_amount, r_1.issue_planned_date, r_1.complexity_level_id, r_1.bed_profile_id, r_1.aud_who, r_1.aud_when, r_1.aud_source, r_1.aud_who_create, r_1.aud_when_create, r_1.aud_source_create, r_1.refusal_employee_id, r_1.is_finance_type_control, r_1.house_call_id, r_1.action_allowed_result_id
  • Index Cond: (r_1.id = s.id)
  • Filter: (r_1.previous_id IS NULL)
  • Buffers: shared hit=8
144. 0.001 0.011 ↓ 0.0 0 1

Limit (cost=1.29..272.89 rows=1 width=4) (actual time=0.011..0.011 rows=0 loops=1)

  • Output: d.id
  • Buffers: shared hit=14
145. 0.000 0.010 ↓ 0.0 0 1

Nested Loop (cost=1.29..272.89 rows=1 width=4) (actual time=0.010..0.010 rows=0 loops=1)

  • Output: d.id
  • Buffers: shared hit=14
146. 0.002 0.010 ↓ 0.0 0 1

Nested Loop (cost=1.00..272.57 rows=1 width=4) (actual time=0.010..0.010 rows=0 loops=1)

  • Output: r_2.department_id
  • Buffers: shared hit=14
147. 0.004 0.004 ↑ 13.5 2 1

Index Scan using mc_step_case_ix on public.mc_step s_1 (cost=0.57..44.22 rows=27 width=4) (actual time=0.004..0.004 rows=2 loops=1)

  • Output: s_1.id, s_1.admission_date, s_1.admission_time, s_1.death_date, s_1.death_time, s_1.outcome_date, s_1.outcome_time, s_1.death_employee_id, s_1.main_diagnosis_id, s_1.case_id, s_1.outcome_id, s_1.outcome_clinic_id, s_1.outcome_regimen_id, s_1.regimen_id, s_1.res_group_id, s_1.result_id, s_1.reason_id, s_1.profile_id, s_1.mes_id, s_1.mes_quality_criterion_id, s_1.is_continue, s_1.is_continue_editable, s_1.standard_id, s_1.csg_id, s_1.vmp_type_id, s_1.vmp_method_id, s_1.deviation_reason_id, s_1.aud_who, s_1.aud_when, s_1.aud_source, s_1.aud_who_create, s_1.aud_when_create, s_1.aud_source_create, s_1._clinic_id, s_1._patient_id, s_1.planned_date_closing_case, s_1.hsp_bed_profile_id, s_1.gestational_age, s_1.onko_stage
  • Index Cond: (s_1.case_id = c.id)
  • Buffers: shared hit=6
148. 0.004 0.004 ↓ 0.0 0 2

Index Scan using hsp_record_pk on public.hsp_record r_2 (cost=0.43..8.45 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=2)

  • Output: r_2.id, r_2.is_admission_day_counts, r_2.old_is_continue, r_2.department_id, r_2.funding_id, r_2.mes_id, r_2.previous_id, r_2.is_set_diagnosis, r_2.old_is_continue_edit, r_2.is_diag_not_eq, r_2.days_comp_algo_id, r_2.missed_days_amount, r_2.bed_days_amount, r_2.issue_planned_date, r_2.complexity_level_id, r_2.bed_profile_id, r_2.aud_who, r_2.aud_when, r_2.aud_source, r_2.aud_who_create, r_2.aud_when_create, r_2.aud_source_create, r_2.refusal_employee_id, r_2.is_finance_type_control, r_2.house_call_id, r_2.action_allowed_result_id
  • Index Cond: (r_2.id = s_1.id)
  • Filter: (r_2.previous_id IS NULL)
  • Buffers: shared hit=8
149. 0.000 0.000 ↓ 0.0 0

Index Only Scan using pim_department_pk on public.pim_department d (cost=0.29..0.31 rows=1 width=4) (never executed)

  • Output: d.id
  • Index Cond: (d.id = r_2.department_id)
  • Heap Fetches: 0
150. 0.000 0.011 ↓ 0.0 0 1

Limit (cost=1.29..272.89 rows=1 width=43) (actual time=0.011..0.011 rows=0 loops=1)

  • Output: d_1.name
  • Buffers: shared hit=14
151. 0.000 0.011 ↓ 0.0 0 1

Nested Loop (cost=1.29..272.89 rows=1 width=43) (actual time=0.011..0.011 rows=0 loops=1)

  • Output: d_1.name
  • Buffers: shared hit=14
152. 0.003 0.011 ↓ 0.0 0 1

Nested Loop (cost=1.00..272.57 rows=1 width=4) (actual time=0.011..0.011 rows=0 loops=1)

  • Output: r_3.department_id
  • Buffers: shared hit=14
153. 0.004 0.004 ↑ 13.5 2 1

Index Scan using mc_step_case_ix on public.mc_step s_2 (cost=0.57..44.22 rows=27 width=4) (actual time=0.003..0.004 rows=2 loops=1)

  • Output: s_2.id, s_2.admission_date, s_2.admission_time, s_2.death_date, s_2.death_time, s_2.outcome_date, s_2.outcome_time, s_2.death_employee_id, s_2.main_diagnosis_id, s_2.case_id, s_2.outcome_id, s_2.outcome_clinic_id, s_2.outcome_regimen_id, s_2.regimen_id, s_2.res_group_id, s_2.result_id, s_2.reason_id, s_2.profile_id, s_2.mes_id, s_2.mes_quality_criterion_id, s_2.is_continue, s_2.is_continue_editable, s_2.standard_id, s_2.csg_id, s_2.vmp_type_id, s_2.vmp_method_id, s_2.deviation_reason_id, s_2.aud_who, s_2.aud_when, s_2.aud_source, s_2.aud_who_create, s_2.aud_when_create, s_2.aud_source_create, s_2._clinic_id, s_2._patient_id, s_2.planned_date_closing_case, s_2.hsp_bed_profile_id, s_2.gestational_age, s_2.onko_stage
  • Index Cond: (s_2.case_id = c.id)
  • Buffers: shared hit=6
154. 0.004 0.004 ↓ 0.0 0 2

Index Scan using hsp_record_pk on public.hsp_record r_3 (cost=0.43..8.45 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=2)

  • Output: r_3.id, r_3.is_admission_day_counts, r_3.old_is_continue, r_3.department_id, r_3.funding_id, r_3.mes_id, r_3.previous_id, r_3.is_set_diagnosis, r_3.old_is_continue_edit, r_3.is_diag_not_eq, r_3.days_comp_algo_id, r_3.missed_days_amount, r_3.bed_days_amount, r_3.issue_planned_date, r_3.complexity_level_id, r_3.bed_profile_id, r_3.aud_who, r_3.aud_when, r_3.aud_source, r_3.aud_who_create, r_3.aud_when_create, r_3.aud_source_create, r_3.refusal_employee_id, r_3.is_finance_type_control, r_3.house_call_id, r_3.action_allowed_result_id
  • Index Cond: (r_3.id = s_2.id)
  • Filter: (r_3.previous_id IS NULL)
  • Buffers: shared hit=8
155. 0.000 0.000 ↓ 0.0 0

Index Scan using pim_department_pk on public.pim_department d_1 (cost=0.29..0.31 rows=1 width=47) (never executed)

  • Output: d_1.id, d_1.is_available_diagnosis, d_1.code, d_1.from_dt, d_1.name, d_1.to_dt, d_1.accounting_center_id, d_1.type_id, d_1.funding_id, d_1.org_id, d_1.parent_id, d_1.sphere_id, d_1.is_payment, d_1.unit_id, d_1.lpu_1, d_1.kind_id, d_1.e_code, d_1.scope_id, d_1.aud_who, d_1.aud_when, d_1.aud_source, d_1.aud_who_create, d_1.aud_when_create, d_1.aud_source_create, d_1.is_separate, d_1.is_social_significant, d_1.age_group_id, d_1.is_branch_type, d_1.visits_per_shift, d_1.departures_per_shift, d_1.visits_per_day, d_1.necropsies_per_day, d_1.clinical_trials_per_shift, d_1.brigades_amount, d_1.ose, d_1.ose_reject, d_1.at_home, d_1.longitude, d_1.latitude, d_1.amb_reception_exists
  • Index Cond: (d_1.id = r_3.department_id)
156. 0.001 0.011 ↓ 0.0 0 1

Limit (cost=1.00..272.58 rows=1 width=12) (actual time=0.011..0.011 rows=0 loops=1)

  • Output: ((s_3.admission_date + COALESCE(s_3.admission_time, '00:00:00'::time without time zone)))
  • Buffers: shared hit=14
157. 0.002 0.010 ↓ 0.0 0 1

Nested Loop (cost=1.00..272.58 rows=1 width=12) (actual time=0.010..0.010 rows=0 loops=1)

  • Output: (s_3.admission_date + COALESCE(s_3.admission_time, '00:00:00'::time without time zone))
  • Buffers: shared hit=14
158. 0.004 0.004 ↑ 13.5 2 1

Index Scan using mc_step_case_ix on public.mc_step s_3 (cost=0.57..44.22 rows=27 width=16) (actual time=0.003..0.004 rows=2 loops=1)

  • Output: s_3.id, s_3.admission_date, s_3.admission_time, s_3.death_date, s_3.death_time, s_3.outcome_date, s_3.outcome_time, s_3.death_employee_id, s_3.main_diagnosis_id, s_3.case_id, s_3.outcome_id, s_3.outcome_clinic_id, s_3.outcome_regimen_id, s_3.regimen_id, s_3.res_group_id, s_3.result_id, s_3.reason_id, s_3.profile_id, s_3.mes_id, s_3.mes_quality_criterion_id, s_3.is_continue, s_3.is_continue_editable, s_3.standard_id, s_3.csg_id, s_3.vmp_type_id, s_3.vmp_method_id, s_3.deviation_reason_id, s_3.aud_who, s_3.aud_when, s_3.aud_source, s_3.aud_who_create, s_3.aud_when_create, s_3.aud_source_create, s_3._clinic_id, s_3._patient_id, s_3.planned_date_closing_case, s_3.hsp_bed_profile_id, s_3.gestational_age, s_3.onko_stage
  • Index Cond: (s_3.case_id = c.id)
  • Buffers: shared hit=6
159. 0.004 0.004 ↓ 0.0 0 2

Index Scan using hsp_record_pk on public.hsp_record r_4 (cost=0.43..8.45 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=2)

  • Output: r_4.id, r_4.is_admission_day_counts, r_4.old_is_continue, r_4.department_id, r_4.funding_id, r_4.mes_id, r_4.previous_id, r_4.is_set_diagnosis, r_4.old_is_continue_edit, r_4.is_diag_not_eq, r_4.days_comp_algo_id, r_4.missed_days_amount, r_4.bed_days_amount, r_4.issue_planned_date, r_4.complexity_level_id, r_4.bed_profile_id, r_4.aud_who, r_4.aud_when, r_4.aud_source, r_4.aud_who_create, r_4.aud_when_create, r_4.aud_source_create, r_4.refusal_employee_id, r_4.is_finance_type_control, r_4.house_call_id, r_4.action_allowed_result_id
  • Index Cond: (r_4.id = s_3.id)
  • Filter: (r_4.previous_id IS NULL)
  • Buffers: shared hit=8
160. 0.001 0.012 ↓ 0.0 0 1

Limit (cost=1.56..277.32 rows=1 width=4) (actual time=0.012..0.012 rows=0 loops=1)

  • Output: mcd.id
  • Buffers: shared hit=14
161. 0.001 0.011 ↓ 0.0 0 1

Nested Loop (cost=1.56..277.32 rows=1 width=4) (actual time=0.011..0.011 rows=0 loops=1)

  • Output: mcd.id
  • Buffers: shared hit=14
162. 0.002 0.010 ↓ 0.0 0 1

Nested Loop (cost=1.00..272.57 rows=1 width=4) (actual time=0.010..0.010 rows=0 loops=1)

  • Output: s_4.main_diagnosis_id
  • Buffers: shared hit=14
163. 0.004 0.004 ↑ 13.5 2 1

Index Scan using mc_step_case_ix on public.mc_step s_4 (cost=0.57..44.22 rows=27 width=8) (actual time=0.003..0.004 rows=2 loops=1)

  • Output: s_4.id, s_4.admission_date, s_4.admission_time, s_4.death_date, s_4.death_time, s_4.outcome_date, s_4.outcome_time, s_4.death_employee_id, s_4.main_diagnosis_id, s_4.case_id, s_4.outcome_id, s_4.outcome_clinic_id, s_4.outcome_regimen_id, s_4.regimen_id, s_4.res_group_id, s_4.result_id, s_4.reason_id, s_4.profile_id, s_4.mes_id, s_4.mes_quality_criterion_id, s_4.is_continue, s_4.is_continue_editable, s_4.standard_id, s_4.csg_id, s_4.vmp_type_id, s_4.vmp_method_id, s_4.deviation_reason_id, s_4.aud_who, s_4.aud_when, s_4.aud_source, s_4.aud_who_create, s_4.aud_when_create, s_4.aud_source_create, s_4._clinic_id, s_4._patient_id, s_4.planned_date_closing_case, s_4.hsp_bed_profile_id, s_4.gestational_age, s_4.onko_stage
  • Index Cond: (s_4.case_id = c.id)
  • Buffers: shared hit=6
164. 0.004 0.004 ↓ 0.0 0 2

Index Scan using hsp_record_pk on public.hsp_record r_5 (cost=0.43..8.45 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=2)

  • Output: r_5.id, r_5.is_admission_day_counts, r_5.old_is_continue, r_5.department_id, r_5.funding_id, r_5.mes_id, r_5.previous_id, r_5.is_set_diagnosis, r_5.old_is_continue_edit, r_5.is_diag_not_eq, r_5.days_comp_algo_id, r_5.missed_days_amount, r_5.bed_days_amount, r_5.issue_planned_date, r_5.complexity_level_id, r_5.bed_profile_id, r_5.aud_who, r_5.aud_when, r_5.aud_source, r_5.aud_who_create, r_5.aud_when_create, r_5.aud_source_create, r_5.refusal_employee_id, r_5.is_finance_type_control, r_5.house_call_id, r_5.action_allowed_result_id
  • Index Cond: (r_5.id = s_4.id)
  • Filter: (r_5.previous_id IS NULL)
  • Buffers: shared hit=8
165. 0.000 0.000 ↓ 0.0 0

Index Only Scan using mc_diagnosis_pk on public.mc_diagnosis mcd (cost=0.57..4.73 rows=1 width=4) (never executed)

  • Output: mcd.id
  • Index Cond: (mcd.id = s_4.main_diagnosis_id)
  • Heap Fetches: 0
166. 0.000 0.011 ↓ 0.0 0 1

Nested Loop (cost=1.85..281.49 rows=1 width=93) (actual time=0.011..0.011 rows=0 loops=1)

  • Output: row_to_json(ROW(mdd.id, (((mdd.code)::text || ' '::text) || (mdd.name)::text), mdd.is_injury))
  • Buffers: shared hit=14
167. 0.001 0.011 ↓ 0.0 0 1

Nested Loop (cost=1.56..281.17 rows=1 width=4) (actual time=0.011..0.011 rows=0 loops=1)

  • Output: mcd_1.diagnos_id
  • Buffers: shared hit=14
168. 0.003 0.010 ↓ 0.0 0 1

Nested Loop (cost=1.00..272.57 rows=1 width=4) (actual time=0.010..0.010 rows=0 loops=1)

  • Output: s_5.main_diagnosis_id
  • Buffers: shared hit=14
169. 0.003 0.003 ↑ 13.5 2 1

Index Scan using mc_step_case_ix on public.mc_step s_5 (cost=0.57..44.22 rows=27 width=8) (actual time=0.003..0.003 rows=2 loops=1)

  • Output: s_5.id, s_5.admission_date, s_5.admission_time, s_5.death_date, s_5.death_time, s_5.outcome_date, s_5.outcome_time, s_5.death_employee_id, s_5.main_diagnosis_id, s_5.case_id, s_5.outcome_id, s_5.outcome_clinic_id, s_5.outcome_regimen_id, s_5.regimen_id, s_5.res_group_id, s_5.result_id, s_5.reason_id, s_5.profile_id, s_5.mes_id, s_5.mes_quality_criterion_id, s_5.is_continue, s_5.is_continue_editable, s_5.standard_id, s_5.csg_id, s_5.vmp_type_id, s_5.vmp_method_id, s_5.deviation_reason_id, s_5.aud_who, s_5.aud_when, s_5.aud_source, s_5.aud_who_create, s_5.aud_when_create, s_5.aud_source_create, s_5._clinic_id, s_5._patient_id, s_5.planned_date_closing_case, s_5.hsp_bed_profile_id, s_5.gestational_age, s_5.onko_stage
  • Index Cond: (s_5.case_id = c.id)
  • Buffers: shared hit=6
170. 0.004 0.004 ↓ 0.0 0 2

Index Scan using hsp_record_pk on public.hsp_record r_6 (cost=0.43..8.45 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=2)

  • Output: r_6.id, r_6.is_admission_day_counts, r_6.old_is_continue, r_6.department_id, r_6.funding_id, r_6.mes_id, r_6.previous_id, r_6.is_set_diagnosis, r_6.old_is_continue_edit, r_6.is_diag_not_eq, r_6.days_comp_algo_id, r_6.missed_days_amount, r_6.bed_days_amount, r_6.issue_planned_date, r_6.complexity_level_id, r_6.bed_profile_id, r_6.aud_who, r_6.aud_when, r_6.aud_source, r_6.aud_who_create, r_6.aud_when_create, r_6.aud_source_create, r_6.refusal_employee_id, r_6.is_finance_type_control, r_6.house_call_id, r_6.action_allowed_result_id
  • Index Cond: (r_6.id = s_5.id)
  • Filter: (r_6.previous_id IS NULL)
  • Buffers: shared hit=8
171. 0.000 0.000 ↓ 0.0 0

Index Scan using mc_diagnosis_pk on public.mc_diagnosis mcd_1 (cost=0.57..8.59 rows=1 width=8) (never executed)

  • Output: mcd_1.id, mcd_1.diagnos_id
  • Index Cond: (mcd_1.id = s_5.main_diagnosis_id)
172. 0.000 0.000 ↓ 0.0 0

Index Scan using md_diagnosis_pk on public.md_diagnosis mdd (cost=0.29..0.30 rows=1 width=93) (never executed)

  • Output: mdd.id, mdd.code, mdd.name, mdd.parent_id, mdd.is_injury, mdd.level, mdd.is_leaf, mdd.e_code, mdd.oms, mdd.stomat, mdd.aud_who, mdd.aud_when, mdd.aud_source, mdd.aud_who_create, mdd.aud_when_create, mdd.aud_source_create, mdd.from_dt, mdd.to_dt
  • Index Cond: (mdd.id = mcd_1.diagnos_id)
173. 0.001 0.011 ↓ 0.0 0 1

Nested Loop (cost=1.85..281.49 rows=1 width=92) (actual time=0.011..0.011 rows=0 loops=1)

  • Output: row_to_json(ROW(mdd_1.id, (((mdd_1.code)::text || ' '::text) || (mdd_1.name)::text)))
  • Buffers: shared hit=14
174. 0.000 0.010 ↓ 0.0 0 1

Nested Loop (cost=1.56..281.17 rows=1 width=4) (actual time=0.010..0.010 rows=0 loops=1)

  • Output: mcd_2.injury_reason_id
  • Buffers: shared hit=14
175. 0.001 0.010 ↓ 0.0 0 1

Nested Loop (cost=1.00..272.57 rows=1 width=4) (actual time=0.010..0.010 rows=0 loops=1)

  • Output: s_6.main_diagnosis_id
  • Buffers: shared hit=14
176. 0.003 0.003 ↑ 13.5 2 1

Index Scan using mc_step_case_ix on public.mc_step s_6 (cost=0.57..44.22 rows=27 width=8) (actual time=0.003..0.003 rows=2 loops=1)

  • Output: s_6.id, s_6.admission_date, s_6.admission_time, s_6.death_date, s_6.death_time, s_6.outcome_date, s_6.outcome_time, s_6.death_employee_id, s_6.main_diagnosis_id, s_6.case_id, s_6.outcome_id, s_6.outcome_clinic_id, s_6.outcome_regimen_id, s_6.regimen_id, s_6.res_group_id, s_6.result_id, s_6.reason_id, s_6.profile_id, s_6.mes_id, s_6.mes_quality_criterion_id, s_6.is_continue, s_6.is_continue_editable, s_6.standard_id, s_6.csg_id, s_6.vmp_type_id, s_6.vmp_method_id, s_6.deviation_reason_id, s_6.aud_who, s_6.aud_when, s_6.aud_source, s_6.aud_who_create, s_6.aud_when_create, s_6.aud_source_create, s_6._clinic_id, s_6._patient_id, s_6.planned_date_closing_case, s_6.hsp_bed_profile_id, s_6.gestational_age, s_6.onko_stage
  • Index Cond: (s_6.case_id = c.id)
  • Buffers: shared hit=6
177. 0.006 0.006 ↓ 0.0 0 2

Index Scan using hsp_record_pk on public.hsp_record r_7 (cost=0.43..8.45 rows=1 width=4) (actual time=0.003..0.003 rows=0 loops=2)

  • Output: r_7.id, r_7.is_admission_day_counts, r_7.old_is_continue, r_7.department_id, r_7.funding_id, r_7.mes_id, r_7.previous_id, r_7.is_set_diagnosis, r_7.old_is_continue_edit, r_7.is_diag_not_eq, r_7.days_comp_algo_id, r_7.missed_days_amount, r_7.bed_days_amount, r_7.issue_planned_date, r_7.complexity_level_id, r_7.bed_profile_id, r_7.aud_who, r_7.aud_when, r_7.aud_source, r_7.aud_who_create, r_7.aud_when_create, r_7.aud_source_create, r_7.refusal_employee_id, r_7.is_finance_type_control, r_7.house_call_id, r_7.action_allowed_result_id
  • Index Cond: (r_7.id = s_6.id)
  • Filter: (r_7.previous_id IS NULL)
  • Buffers: shared hit=8
178. 0.000 0.000 ↓ 0.0 0

Index Scan using mc_diagnosis_pk on public.mc_diagnosis mcd_2 (cost=0.57..8.59 rows=1 width=8) (never executed)

  • Output: mcd_2.id, mcd_2.injury_reason_id
  • Index Cond: (mcd_2.id = s_6.main_diagnosis_id)
179. 0.000 0.000 ↓ 0.0 0

Index Scan using md_diagnosis_pk on public.md_diagnosis mdd_1 (cost=0.29..0.30 rows=1 width=92) (never executed)

  • Output: mdd_1.id, mdd_1.code, mdd_1.name, mdd_1.parent_id, mdd_1.is_injury, mdd_1.level, mdd_1.is_leaf, mdd_1.e_code, mdd_1.oms, mdd_1.stomat, mdd_1.aud_who, mdd_1.aud_when, mdd_1.aud_source, mdd_1.aud_who_create, mdd_1.aud_when_create, mdd_1.aud_source_create, mdd_1.from_dt, mdd_1.to_dt
  • Index Cond: (mdd_1.id = mcd_2.injury_reason_id)
180. 0.000 0.011 ↓ 0.0 0 1

Limit (cost=1.57..277.62 rows=1 width=4) (actual time=0.011..0.011 rows=0 loops=1)

  • Output: rg.id
  • Buffers: shared hit=14
181. 0.002 0.011 ↓ 0.0 0 1

Nested Loop (cost=1.57..277.62 rows=1 width=4) (actual time=0.011..0.011 rows=0 loops=1)

  • Output: rg.id
  • Buffers: shared hit=14
182. 0.001 0.009 ↓ 0.0 0 1

Nested Loop (cost=1.00..272.57 rows=1 width=4) (actual time=0.009..0.009 rows=0 loops=1)

  • Output: s_7.res_group_id
  • Buffers: shared hit=14
183. 0.004 0.004 ↑ 13.5 2 1

Index Scan using mc_step_case_ix on public.mc_step s_7 (cost=0.57..44.22 rows=27 width=8) (actual time=0.003..0.004 rows=2 loops=1)

  • Output: s_7.id, s_7.admission_date, s_7.admission_time, s_7.death_date, s_7.death_time, s_7.outcome_date, s_7.outcome_time, s_7.death_employee_id, s_7.main_diagnosis_id, s_7.case_id, s_7.outcome_id, s_7.outcome_clinic_id, s_7.outcome_regimen_id, s_7.regimen_id, s_7.res_group_id, s_7.result_id, s_7.reason_id, s_7.profile_id, s_7.mes_id, s_7.mes_quality_criterion_id, s_7.is_continue, s_7.is_continue_editable, s_7.standard_id, s_7.csg_id, s_7.vmp_type_id, s_7.vmp_method_id, s_7.deviation_reason_id, s_7.aud_who, s_7.aud_when, s_7.aud_source, s_7.aud_who_create, s_7.aud_when_create, s_7.aud_source_create, s_7._clinic_id, s_7._patient_id, s_7.planned_date_closing_case, s_7.hsp_bed_profile_id, s_7.gestational_age, s_7.onko_stage
  • Index Cond: (s_7.case_id = c.id)
  • Buffers: shared hit=6
184. 0.004 0.004 ↓ 0.0 0 2

Index Scan using hsp_record_pk on public.hsp_record r_8 (cost=0.43..8.45 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=2)

  • Output: r_8.id, r_8.is_admission_day_counts, r_8.old_is_continue, r_8.department_id, r_8.funding_id, r_8.mes_id, r_8.previous_id, r_8.is_set_diagnosis, r_8.old_is_continue_edit, r_8.is_diag_not_eq, r_8.days_comp_algo_id, r_8.missed_days_amount, r_8.bed_days_amount, r_8.issue_planned_date, r_8.complexity_level_id, r_8.bed_profile_id, r_8.aud_who, r_8.aud_when, r_8.aud_source, r_8.aud_who_create, r_8.aud_when_create, r_8.aud_source_create, r_8.refusal_employee_id, r_8.is_finance_type_control, r_8.house_call_id, r_8.action_allowed_result_id
  • Index Cond: (r_8.id = s_7.id)
  • Filter: (r_8.previous_id IS NULL)
  • Buffers: shared hit=8
185. 0.000 0.000 ↓ 0.0 0

Index Only Scan using sr_res_group_pk on public.sr_res_group rg (cost=0.57..5.03 rows=1 width=4) (never executed)

  • Output: rg.id
  • Index Cond: (rg.id = s_7.res_group_id)
  • Heap Fetches: 0
186. 0.001 0.012 ↓ 0.0 0 1

Limit (cost=1.86..281.49 rows=1 width=4) (actual time=0.012..0.012 rows=0 loops=1)

  • Output: epr.id
  • Buffers: shared hit=14
187. 0.001 0.011 ↓ 0.0 0 1

Nested Loop (cost=1.86..281.49 rows=1 width=4) (actual time=0.011..0.011 rows=0 loops=1)

  • Output: epr.id
  • Buffers: shared hit=14
188. 0.000 0.010 ↓ 0.0 0 1

Nested Loop (cost=1.57..281.17 rows=1 width=4) (actual time=0.010..0.010 rows=0 loops=1)

  • Output: rg_1.responsible_id
  • Buffers: shared hit=14
189. 0.002 0.010 ↓ 0.0 0 1

Nested Loop (cost=1.00..272.57 rows=1 width=4) (actual time=0.010..0.010 rows=0 loops=1)

  • Output: s_8.res_group_id
  • Buffers: shared hit=14
190. 0.004 0.004 ↑ 13.5 2 1

Index Scan using mc_step_case_ix on public.mc_step s_8 (cost=0.57..44.22 rows=27 width=8) (actual time=0.003..0.004 rows=2 loops=1)

  • Output: s_8.id, s_8.admission_date, s_8.admission_time, s_8.death_date, s_8.death_time, s_8.outcome_date, s_8.outcome_time, s_8.death_employee_id, s_8.main_diagnosis_id, s_8.case_id, s_8.outcome_id, s_8.outcome_clinic_id, s_8.outcome_regimen_id, s_8.regimen_id, s_8.res_group_id, s_8.result_id, s_8.reason_id, s_8.profile_id, s_8.mes_id, s_8.mes_quality_criterion_id, s_8.is_continue, s_8.is_continue_editable, s_8.standard_id, s_8.csg_id, s_8.vmp_type_id, s_8.vmp_method_id, s_8.deviation_reason_id, s_8.aud_who, s_8.aud_when, s_8.aud_source, s_8.aud_who_create, s_8.aud_when_create, s_8.aud_source_create, s_8._clinic_id, s_8._patient_id, s_8.planned_date_closing_case, s_8.hsp_bed_profile_id, s_8.gestational_age, s_8.onko_stage
  • Index Cond: (s_8.case_id = c.id)
  • Buffers: shared hit=6
191. 0.004 0.004 ↓ 0.0 0 2

Index Scan using hsp_record_pk on public.hsp_record r_9 (cost=0.43..8.45 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=2)

  • Output: r_9.id, r_9.is_admission_day_counts, r_9.old_is_continue, r_9.department_id, r_9.funding_id, r_9.mes_id, r_9.previous_id, r_9.is_set_diagnosis, r_9.old_is_continue_edit, r_9.is_diag_not_eq, r_9.days_comp_algo_id, r_9.missed_days_amount, r_9.bed_days_amount, r_9.issue_planned_date, r_9.complexity_level_id, r_9.bed_profile_id, r_9.aud_who, r_9.aud_when, r_9.aud_source, r_9.aud_who_create, r_9.aud_when_create, r_9.aud_source_create, r_9.refusal_employee_id, r_9.is_finance_type_control, r_9.house_call_id, r_9.action_allowed_result_id
  • Index Cond: (r_9.id = s_8.id)
  • Filter: (r_9.previous_id IS NULL)
  • Buffers: shared hit=8
192. 0.000 0.000 ↓ 0.0 0

Index Scan using sr_res_group_pk on public.sr_res_group rg_1 (cost=0.57..8.59 rows=1 width=8) (never executed)

  • Output: rg_1.id, rg_1.bdate, rg_1.edate, rg_1.is_system, rg_1.name, rg_1.department_id, rg_1.org_id, rg_1.responsible_id, rg_1.is_available_in_electronic_queue, rg_1.label_id, rg_1.note, rg_1.blocked, rg_1.block_comment, rg_1.template_res_group_id, rg_1.emergency, rg_1.ignore_districts, rg_1.aud_who, rg_1.aud_when, rg_1.aud_source, rg_1.aud_who_create, rg_1.aud_when_create, rg_1.aud_source_create, rg_1.ignore_regclinic_check, rg_1.service_template_id
  • Index Cond: (rg_1.id = s_8.res_group_id)
193. 0.000 0.000 ↓ 0.0 0

Index Scan using employee_position_id_unique on public.pim_employee_position_resource epr (cost=0.29..0.31 rows=1 width=8) (never executed)

  • Output: epr.id, epr.employee_position_id, epr.aud_who, epr.aud_when, epr.aud_source, epr.aud_who_create, epr.aud_when_create, epr.aud_source_create
  • Index Cond: (epr.employee_position_id = rg_1.responsible_id)
194. 0.001 0.007 ↓ 0.0 0 1

Limit (cost=8.45..8.45 rows=1 width=8) (actual time=0.007..0.007 rows=0 loops=1)

  • Output: slp.id, slp.from_dt
195. 0.006 0.006 ↓ 0.0 0 1

Sort (cost=8.45..8.45 rows=1 width=8) (actual time=0.006..0.006 rows=0 loops=1)

  • Output: slp.id, slp.from_dt
  • Sort Key: slp.from_dt
  • Sort Method: quicksort Memory: 25kB
196. 0.000 0.000 ↓ 0.0 0 1

Index Scan using md_sicklist_period_sicklist_id_idx on public.md_sicklist_period slp (cost=0.42..8.44 rows=1 width=8) (actual time=0.000..0.000 rows=0 loops=1)

  • Output: slp.id, slp.from_dt
  • Index Cond: (slp.sicklist_id = sl.id)
197. 0.002 0.002 ↑ 1.0 1 1

Aggregate (cost=8.44..8.45 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=1)

  • Output: min(slp_1.from_dt)
198. 0.000 0.000 ↓ 0.0 0 1

Index Scan using md_sicklist_period_sicklist_id_idx on public.md_sicklist_period slp_1 (cost=0.42..8.44 rows=1 width=4) (actual time=0.000..0.000 rows=0 loops=1)

  • Output: slp_1.id, slp_1.from_dt, slp_1.to_dt, slp_1.employee_position_id, slp_1.sicklist_id, slp_1.witness_employee_position_id, slp_1.aud_who, slp_1.aud_when, slp_1.aud_source, slp_1.aud_who_create, slp_1.aud_when_create, slp_1.aud_source_create
  • Index Cond: (slp_1.sicklist_id = sl.id)
199. 0.000 0.003 ↓ 0.0 0 1

Limit (cost=8.45..8.45 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=1)

  • Output: slp_2.id, slp_2.to_dt
200. 0.003 0.003 ↓ 0.0 0 1

Sort (cost=8.45..8.45 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=1)

  • Output: slp_2.id, slp_2.to_dt
  • Sort Key: slp_2.to_dt DESC
  • Sort Method: quicksort Memory: 25kB
201. 0.000 0.000 ↓ 0.0 0 1

Index Scan using md_sicklist_period_sicklist_id_idx on public.md_sicklist_period slp_2 (cost=0.42..8.44 rows=1 width=8) (actual time=0.000..0.000 rows=0 loops=1)

  • Output: slp_2.id, slp_2.to_dt
  • Index Cond: (slp_2.sicklist_id = sl.id)
202. 0.000 0.002 ↓ 0.0 0 1

Limit (cost=8.45..8.45 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=1)

  • Output: slp_3.to_dt
203. 0.002 0.002 ↓ 0.0 0 1

Sort (cost=8.45..8.45 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=1)

  • Output: slp_3.to_dt
  • Sort Key: slp_3.to_dt DESC
  • Sort Method: quicksort Memory: 25kB
204. 0.000 0.000 ↓ 0.0 0 1

Index Scan using md_sicklist_period_sicklist_id_idx on public.md_sicklist_period slp_3 (cost=0.42..8.44 rows=1 width=4) (actual time=0.000..0.000 rows=0 loops=1)

  • Output: slp_3.to_dt
  • Index Cond: (slp_3.sicklist_id = sl.id)
205. 0.000 0.001 ↓ 0.0 0 1

Limit (cost=0.42..8.44 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=1)

  • Output: (CASE WHEN (md_sicklist.disability_reason_id = 9) THEN true ELSE false END)
206. 0.001 0.001 ↓ 0.0 0 1

Index Scan using md_sicklist_pk on public.md_sicklist (cost=0.42..8.44 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=1)

  • Output: CASE WHEN (md_sicklist.disability_reason_id = 9) THEN true ELSE false END
  • Index Cond: (md_sicklist.id = sl.id)
207. 0.001 0.001 ↓ 0.0 0 1

Limit (cost=0.42..8.44 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=1)

  • Output: md_sicklist_1.patient_id
208. 0.000 0.000 ↓ 0.0 0 1

Index Scan using md_sicklist_pk on public.md_sicklist md_sicklist_1 (cost=0.42..8.44 rows=1 width=4) (actual time=0.000..0.000 rows=0 loops=1)

  • Output: md_sicklist_1.patient_id
  • Index Cond: (md_sicklist_1.id = sl.id)
209. 0.000 0.008 ↑ 1.0 1 1

Limit (cost=0.57..8.59 rows=1 width=4) (actual time=0.008..0.008 rows=1 loops=1)

  • Output: s_9.outcome_date
  • Buffers: shared hit=5
210. 0.008 0.008 ↑ 1.0 1 1

Index Scan using mc_step_pk on public.mc_step s_9 (cost=0.57..8.59 rows=1 width=4) (actual time=0.008..0.008 rows=1 loops=1)

  • Output: s_9.outcome_date
  • Index Cond: (s_9.id = c.closing_step_id)
  • Buffers: shared hit=5
211. 1.586 1.586 ↑ 1.0 1 1

Result (cost=0.00..0.26 rows=1 width=0) (actual time=1.586..1.586 rows=1 loops=1)

  • Output: get_bed_day_amount_n2o(c.id)
  • Buffers: shared hit=55
212. 0.004 0.039 ↑ 1.0 1 1

Limit (cost=8.60..9.90 rows=1 width=31) (actual time=0.039..0.039 rows=1 loops=1)

  • Output: scr.name
  • Buffers: shared hit=7
213. 0.013 0.035 ↑ 1.0 1 1

Hash Join (cost=8.60..9.90 rows=1 width=31) (actual time=0.035..0.035 rows=1 loops=1)

  • Output: scr.name
  • Hash Cond: (scr.id = s_10.outcome_id)
  • Buffers: shared hit=7
214. 0.008 0.008 ↑ 1.8 12 1

Seq Scan on public.mc_step_care_result scr (cost=0.00..1.21 rows=21 width=35) (actual time=0.005..0.008 rows=12 loops=1)

  • Output: scr.id, scr.code, scr.name, scr.e_code, scr.aud_who, scr.aud_when, scr.aud_source, scr.aud_who_create, scr.aud_when_create, scr.aud_source_create, scr.from_dt, scr.to_dt
  • Buffers: shared hit=1
215. 0.002 0.014 ↑ 1.0 1 1

Hash (cost=8.59..8.59 rows=1 width=4) (actual time=0.014..0.014 rows=1 loops=1)

  • Output: s_10.outcome_id
  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
  • Buffers: shared hit=6
216. 0.012 0.012 ↑ 1.0 1 1

Index Scan using mc_step_pk on public.mc_step s_10 (cost=0.57..8.59 rows=1 width=4) (actual time=0.008..0.012 rows=1 loops=1)

  • Output: s_10.outcome_id
  • Index Cond: (s_10.id = c.closing_step_id)
  • Buffers: shared hit=6
217. 0.004 0.055 ↑ 1.0 1 1

Limit (cost=8.60..14.05 rows=1 width=157) (actual time=0.054..0.055 rows=1 loops=1)

  • Output: sr.name
  • Buffers: shared hit=9
218. 0.021 0.051 ↑ 1.0 1 1

Hash Join (cost=8.60..14.05 rows=1 width=157) (actual time=0.051..0.051 rows=1 loops=1)

  • Output: sr.name
  • Hash Cond: (sr.id = s_11.result_id)
  • Buffers: shared hit=9
219. 0.022 0.022 ↑ 1.4 77 1

Seq Scan on public.mc_step_result sr (cost=0.00..5.05 rows=105 width=161) (actual time=0.010..0.022 rows=77 loops=1)

  • Output: sr.id, sr.is_closed, sr.code, sr.is_death, sr.is_future, sr.name, sr.is_planning, sr.is_reason, sr.is_refusal, sr.is_transfer_permitted, sr.clinic_id, sr.e_code, sr.aud_who, sr.aud_when, sr.aud_source, sr.aud_who_create, sr.aud_when_create, sr.aud_source_create, sr.from_dt, sr.to_dt
  • Buffers: shared hit=3
220. 0.001 0.008 ↑ 1.0 1 1

Hash (cost=8.59..8.59 rows=1 width=4) (actual time=0.008..0.008 rows=1 loops=1)

  • Output: s_11.result_id
  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
  • Buffers: shared hit=6
221. 0.007 0.007 ↑ 1.0 1 1

Index Scan using mc_step_pk on public.mc_step s_11 (cost=0.57..8.59 rows=1 width=4) (actual time=0.006..0.007 rows=1 loops=1)

  • Output: s_11.result_id
  • Index Cond: (s_11.id = c.closing_step_id)
  • Buffers: shared hit=6
222. 0.000 0.025 ↓ 0.0 0 1

Limit (cost=1.99..274.04 rows=1 width=4) (actual time=0.025..0.025 rows=0 loops=1)

  • Output: r_10.id
  • Buffers: shared hit=12
223. 0.001 0.025 ↓ 0.0 0 1

Nested Loop (cost=1.99..274.04 rows=1 width=4) (actual time=0.025..0.025 rows=0 loops=1)

  • Output: r_10.id
  • Join Filter: (s2.id = r2.id)
  • Buffers: shared hit=12
224. 0.001 0.024 ↓ 0.0 0 1

Nested Loop (cost=1.56..273.51 rows=1 width=12) (actual time=0.024..0.024 rows=0 loops=1)

  • Output: r_10.id, r_10.previous_id, s2.id
  • Buffers: shared hit=12
225. 0.001 0.023 ↓ 0.0 0 1

Nested Loop (cost=1.00..272.57 rows=1 width=12) (actual time=0.023..0.023 rows=0 loops=1)

  • Output: r_10.id, r_10.previous_id, s2.id
  • Buffers: shared hit=12
226. 0.008 0.008 ↑ 13.5 2 1

Index Scan using mc_step_case_ix on public.mc_step s2 (cost=0.57..44.22 rows=27 width=4) (actual time=0.006..0.008 rows=2 loops=1)

  • Output: s2.id, s2.admission_date, s2.admission_time, s2.death_date, s2.death_time, s2.outcome_date, s2.outcome_time, s2.death_employee_id, s2.main_diagnosis_id, s2.case_id, s2.outcome_id, s2.outcome_clinic_id, s2.outcome_regimen_id, s2.regimen_id, s2.res_group_id, s2.result_id, s2.reason_id, s2.profile_id, s2.mes_id, s2.mes_quality_criterion_id, s2.is_continue, s2.is_continue_editable, s2.standard_id, s2.csg_id, s2.vmp_type_id, s2.vmp_method_id, s2.deviation_reason_id, s2.aud_who, s2.aud_when, s2.aud_source, s2.aud_who_create, s2.aud_when_create, s2.aud_source_create, s2._clinic_id, s2._patient_id, s2.planned_date_closing_case, s2.hsp_bed_profile_id, s2.gestational_age, s2.onko_stage
  • Index Cond: (s2.case_id = c.id)
  • Buffers: shared hit=6
227. 0.014 0.014 ↓ 0.0 0 2

Index Scan using hsp_record_previous_id_idx on public.hsp_record r_10 (cost=0.43..8.45 rows=1 width=8) (actual time=0.007..0.007 rows=0 loops=2)

  • Output: r_10.id, r_10.is_admission_day_counts, r_10.old_is_continue, r_10.department_id, r_10.funding_id, r_10.mes_id, r_10.previous_id, r_10.is_set_diagnosis, r_10.old_is_continue_edit, r_10.is_diag_not_eq, r_10.days_comp_algo_id, r_10.missed_days_amount, r_10.bed_days_amount, r_10.issue_planned_date, r_10.complexity_level_id, r_10.bed_profile_id, r_10.aud_who, r_10.aud_when, r_10.aud_source, r_10.aud_who_create, r_10.aud_when_create, r_10.aud_source_create, r_10.refusal_employee_id, r_10.is_finance_type_control, r_10.house_call_id, r_10.action_allowed_result_id
  • Index Cond: (r_10.previous_id = s2.id)
  • Buffers: shared hit=6
228. 0.000 0.000 ↓ 0.0 0

Index Only Scan using mc_step_pk on public.mc_step s_12 (cost=0.57..0.93 rows=1 width=4) (never executed)

  • Output: s_12.id
  • Index Cond: (s_12.id = r_10.id)
  • Heap Fetches: 0
229. 0.000 0.000 ↓ 0.0 0

Index Scan using hsp_record_pk on public.hsp_record r2 (cost=0.43..0.51 rows=1 width=4) (never executed)

  • Output: r2.id, r2.is_admission_day_counts, r2.old_is_continue, r2.department_id, r2.funding_id, r2.mes_id, r2.previous_id, r2.is_set_diagnosis, r2.old_is_continue_edit, r2.is_diag_not_eq, r2.days_comp_algo_id, r2.missed_days_amount, r2.bed_days_amount, r2.issue_planned_date, r2.complexity_level_id, r2.bed_profile_id, r2.aud_who, r2.aud_when, r2.aud_source, r2.aud_who_create, r2.aud_when_create, r2.aud_source_create, r2.refusal_employee_id, r2.is_finance_type_control, r2.house_call_id, r2.action_allowed_result_id
  • Index Cond: (r2.id = r_10.previous_id)
  • Filter: (r2.previous_id IS NULL)
230. 0.000 0.000 ↓ 0.0 0

Index Only Scan using telephone_message_case_ix on hospital.telephone_message tm (cost=0.14..8.16 rows=1 width=0) (never executed)

  • Index Cond: (tm.case_id = c.id)
  • Heap Fetches: 0
231. 0.000 0.000 ↓ 0.0 0 1

Seq Scan on hospital.telephone_message tm_1 (cost=0.00..10.50 rows=50 width=4) (actual time=0.000..0.000 rows=0 loops=1)

  • Output: tm_1.case_id
232. 0.000 0.000 ↓ 0.0 0

Index Only Scan using document_event_case_id_ix on hospital.document_event de (cost=0.14..8.16 rows=1 width=0) (never executed)

  • Index Cond: (de.case_id = c.id)
  • Heap Fetches: 0
233. 0.000 0.000 ↓ 0.0 0 1

Seq Scan on hospital.document_event de_1 (cost=0.00..11.10 rows=110 width=4) (actual time=0.000..0.000 rows=0 loops=1)

  • Output: de_1.case_id
234. 0.002 0.020 ↑ 1.0 1 1

Result (cost=1.10..1.11 rows=1 width=0) (actual time=0.020..0.020 rows=1 loops=1)

  • Output: (mcr.id <> $73)
  • Buffers: shared hit=1
235.          

Initplan (forResult)

236. 0.001 0.018 ↑ 1.0 1 1

Limit (cost=0.00..1.10 rows=1 width=4) (actual time=0.018..0.018 rows=1 loops=1)

  • Output: mc_care_regimen.id
  • Buffers: shared hit=1
237. 0.017 0.017 ↑ 1.0 1 1

Seq Scan on public.mc_care_regimen (cost=0.00..1.10 rows=1 width=4) (actual time=0.017..0.017 rows=1 loops=1)

  • Output: mc_care_regimen.id
  • Filter: (mc_care_regimen.code = 6)
  • Rows Removed by Filter: 5
  • Buffers: shared hit=1
238. 0.000 0.000 ↓ 0.0 0

Nested Loop Semi Join (cost=0.43..9.52 rows=1 width=0) (never executed)

  • Join Filter: (pim_individual_1.gender_id = pim_gender.id)
239. 0.000 0.000 ↓ 0.0 0

Index Scan using pim_individual_pk on public.pim_individual pim_individual_1 (cost=0.43..8.45 rows=1 width=4) (never executed)

  • Output: pim_individual_1.id, pim_individual_1.birth_dt, pim_individual_1.death_dt, pim_individual_1.has_citizenship, pim_individual_1.name, pim_individual_1.patr_name, pim_individual_1.surname, pim_individual_1.gender_id, pim_individual_1.nationality_id, pim_individual_1.list_identity_doc, pim_individual_1.list_oms_doc, pim_individual_1.list_job_org, pim_individual_1.list_reg_name, pim_individual_1.list_snils, pim_individual_1.list_uid, pim_individual_1.aud_who, pim_individual_1.aud_when, pim_individual_1.aud_source, pim_individual_1.aud_who_create, pim_individual_1.aud_when_create, pim_individual_1.aud_source_create, pim_individual_1.birth_place, pim_individual_1.age_year, pim_individual_1.age_month, pim_individual_1.age_day, pim_individual_1.list_main_contact
  • Index Cond: (pim_individual_1.id = c.patient_id)
240. 0.000 0.000 ↓ 0.0 0

Materialize (cost=0.00..1.05 rows=1 width=4) (never executed)

  • Output: pim_gender.id
241. 0.000 0.000 ↓ 0.0 0

Limit (cost=0.00..1.04 rows=1 width=4) (never executed)

  • Output: pim_gender.id
242. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.pim_gender (cost=0.00..1.04 rows=1 width=4) (never executed)

  • Output: pim_gender.id
  • Filter: ((pim_gender.code)::text = 'FEMALE'::text)
243. 530.302 1,928.149 ↓ 1.4 3,150,607 1

Nested Loop (cost=1.48..103,234.17 rows=2,314,747 width=4) (actual time=0.097..1,928.149 rows=3,150,607 loops=1)

  • Output: pim_individual_2.id
  • Buffers: shared hit=1646252
244. 0.006 0.037 ↑ 1.0 1 1

HashAggregate (cost=1.05..1.06 rows=1 width=4) (actual time=0.036..0.037 rows=1 loops=1)

  • Output: pim_gender_1.id
  • Group Key: pim_gender_1.id
  • Buffers: shared hit=1
245. 0.003 0.031 ↑ 1.0 1 1

Limit (cost=0.00..1.04 rows=1 width=4) (actual time=0.030..0.031 rows=1 loops=1)

  • Output: pim_gender_1.id
  • Buffers: shared hit=1
246. 0.028 0.028 ↑ 1.0 1 1

Seq Scan on public.pim_gender pim_gender_1 (cost=0.00..1.04 rows=1 width=4) (actual time=0.028..0.028 rows=1 loops=1)

  • Output: pim_gender_1.id
  • Filter: ((pim_gender_1.code)::text = 'FEMALE'::text)
  • Rows Removed by Filter: 1
  • Buffers: shared hit=1
247. 1,397.810 1,397.810 ↓ 1.4 3,150,607 1

Index Only Scan using pim_individual__gender_id_id_ix on public.pim_individual pim_individual_2 (cost=0.43..80,085.64 rows=2,314,747 width=8) (actual time=0.052..1,397.810 rows=3,150,607 loops=1)

  • Output: pim_individual_2.gender_id, pim_individual_2.id
  • Index Cond: (pim_individual_2.gender_id = pim_gender_1.id)
  • Heap Fetches: 213729
  • Buffers: shared hit=1646251
248. 0.002 0.063 ↓ 0.0 0 1

Limit (cost=1.56..281.17 rows=1 width=8) (actual time=0.063..0.063 rows=0 loops=1)

  • Output: main_diag_1.note
  • Buffers: shared hit=14
249. 0.003 0.061 ↓ 0.0 0 1

Nested Loop (cost=1.56..281.17 rows=1 width=8) (actual time=0.061..0.061 rows=0 loops=1)

  • Output: main_diag_1.note
  • Buffers: shared hit=14
250. 0.006 0.058 ↓ 0.0 0 1

Nested Loop (cost=1.00..272.57 rows=1 width=4) (actual time=0.058..0.058 rows=0 loops=1)

  • Output: s_17.main_diagnosis_id
  • Buffers: shared hit=14
251. 0.032 0.032 ↑ 13.5 2 1

Index Scan using mc_step_case_ix on public.mc_step s_17 (cost=0.57..44.22 rows=27 width=8) (actual time=0.028..0.032 rows=2 loops=1)

  • Output: s_17.id, s_17.admission_date, s_17.admission_time, s_17.death_date, s_17.death_time, s_17.outcome_date, s_17.outcome_time, s_17.death_employee_id, s_17.main_diagnosis_id, s_17.case_id, s_17.outcome_id, s_17.outcome_clinic_id, s_17.outcome_regimen_id, s_17.regimen_id, s_17.res_group_id, s_17.result_id, s_17.reason_id, s_17.profile_id, s_17.mes_id, s_17.mes_quality_criterion_id, s_17.is_continue, s_17.is_continue_editable, s_17.standard_id, s_17.csg_id, s_17.vmp_type_id, s_17.vmp_method_id, s_17.deviation_reason_id, s_17.aud_who, s_17.aud_when, s_17.aud_source, s_17.aud_who_create, s_17.aud_when_create, s_17.aud_source_create, s_17._clinic_id, s_17._patient_id, s_17.planned_date_closing_case, s_17.hsp_bed_profile_id, s_17.gestational_age, s_17.onko_stage
  • Index Cond: (s_17.case_id = c.id)
  • Buffers: shared hit=6
252. 0.020 0.020 ↓ 0.0 0 2

Index Scan using hsp_record_pk on public.hsp_record r_11 (cost=0.43..8.45 rows=1 width=4) (actual time=0.010..0.010 rows=0 loops=2)

  • Output: r_11.id, r_11.is_admission_day_counts, r_11.old_is_continue, r_11.department_id, r_11.funding_id, r_11.mes_id, r_11.previous_id, r_11.is_set_diagnosis, r_11.old_is_continue_edit, r_11.is_diag_not_eq, r_11.days_comp_algo_id, r_11.missed_days_amount, r_11.bed_days_amount, r_11.issue_planned_date, r_11.complexity_level_id, r_11.bed_profile_id, r_11.aud_who, r_11.aud_when, r_11.aud_source, r_11.aud_who_create, r_11.aud_when_create, r_11.aud_source_create, r_11.refusal_employee_id, r_11.is_finance_type_control, r_11.house_call_id, r_11.action_allowed_result_id
  • Index Cond: (r_11.id = s_17.id)
  • Filter: (r_11.previous_id IS NULL)
  • Buffers: shared hit=8
253. 0.000 0.000 ↓ 0.0 0

Index Scan using mc_diagnosis_pk on public.mc_diagnosis main_diag_1 (cost=0.57..8.59 rows=1 width=12) (never executed)

  • Output: main_diag_1.note, main_diag_1.id
  • Index Cond: (main_diag_1.id = s_17.main_diagnosis_id)
254. 0.001 0.001 ↓ 0.0 0 1

Index Scan using pim_department_pk on public.pim_department (cost=0.29..8.30 rows=1 width=43) (actual time=0.001..0.001 rows=0 loops=1)

  • Output: pim_department.name
  • Index Cond: (pim_department.id = r.department_id)
Planning time : 215.660 ms
Execution time : 4,189.112 ms