explain.depesz.com

PostgreSQL's explain analyze made readable

Result: itgp

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 467.570 ↑ 1.0 1 1

Limit (cost=8,106.75..25,050.31 rows=1 width=1,520) (actual time=466.202..467.570 rows=1 loops=1)

  • Output: ssr.id, ((SubPlan 1)), mc.id, mc.id, mc.uid, (CASE WHEN ((mc.main_diagnos_id IS NULL) AND (mc.open_date IS NOT NULL)) THEN (('№'::text || (COALESCE(mc.uid, ''::character varying))::text) || CASE WHEN (mc.closing_step_id IS NULL) THEN (' Открыт:'::text || COALESCE(to_char((mc.open_date)::timestamp with time zone, 'dd.mm.yyyy'::text), ''::text)) ELSE (' Закрыт:'::text || COALESCE(to_char((mc.close_date)::timestamp with time zone, 'dd.mm.yyyy'::text), ''::text)) END) ELSE (((('№'::text || (COALESCE(mc.uid, ''::character varying))::text) || CASE WHEN (mc.closing_step_id IS NULL) THEN (' Открыт:'::text || COALESCE(to_char((mc.open_date)::timestamp with time zone, 'dd.mm.yyyy'::text), ''::text)) ELSE (' Закрыт:'::text || COALESCE(to_char((mc.close_date)::timestamp with time zone, 'dd.mm.yyyy'::text), ''::text)) END) || ' '::text) || (SubPlan 2)) END), mc.open_date, ((SubPlan 3)), ((SubPlan 4)), mc.is_finance_type_control, mc.is_finance_type_control, ((SubPlan 5)), ((SubPlan 6)), ($13), ((SubPlan 8)), ((SubPlan 9)), ((SubPlan 10)), ((SubPlan 11)), ((SubPlan 12)), mar.external_reason_input_is_allowed, ((SubPlan 13)), (NULL::unknown), (NULL::unknown), (COALESCE(mc.is_social_significant, $30)), mc.id, mc.patient_id, ((SubPlan 15)), ((SubPlan 16)), (CASE WHEN (mc.closing_step_id IS NULL) THEN false ELSE true END), ((((((((COALESCE(pirg.surname, ''::character varying))::text || ' '::text) || (COALESCE(pirg.name, ''::character varying))::text) || ' '::text) || (COALESCE(pirg.patr_name, ''::character varying))::text) || '
  • '::text) || (COALESCE(perg.note, ''::character varying))::text)), srgrg.id, peprg.id, mc.main_diagnos_id, ((SubPlan 17)), ms.id, (CASE WHEN (ms.id IS NULL) THEN CASE WHEN (ma.id IS NULL) THEN now() ELSE (ma.bdatetime)::timestamp with time zone END ELSE ((ms.admission_date + ms.admission_time))::timestamp with time zone END), (CASE WHEN (ms.id IS NULL) THEN CASE WHEN (ma.id IS NULL) THEN now() ELSE (ma.bdatetime)::timestamp with time zone END ELSE (ms.admission_date)::timestamp with time zone END), ms.outcome_date, (CASE WHEN (ms.id IS NULL) THEN CASE WHEN (ma.id IS NULL) THEN now() ELSE (ma.bdatetime)::timestamp with time zone END ELSE ((ms.admission_date + ms.admission_time))::timestamp with time zone END), pv.place_id, ms.res_group_id, (CASE WHEN (md.stage_id IS NULL) THEN 3 ELSE md.stage_id END), (CASE WHEN (ms.id IS NULL) THEN CASE WHEN (ma.id IS NULL) THEN CASE WHEN (($34 > 1) OR ($36 > 1)) THEN NULL::integer ELSE $38 END ELSE CASE WHEN (srgp.profile_id IS NULL) THEN NULL::integer ELSE srgp.profile_id END END ELSE ms.profile_id END), (CASE WHEN (ms.id IS NULL) THEN CASE WHEN (ma.id IS NULL) THEN CASE WHEN (($39 > 1) OR ($41 > 1)) THEN NULL::text ELSE $44 END ELSE CASE WHEN (srgp.profile_id IS NULL) THEN NULL::text ELSE (SubPlan 27) END END ELSE (SubPlan 28) END), md1.id, ((((md1.code)::text || ' '::text) || (md1.name)::text)), md1.code, md1.is_injury, md2.id, ((((md2.code)::text || ' '::text) || (md2.name)::text)), mar.id, ((((mar.code)::text || ' '::text) || (mar.name)::text)), md.id, md.is_zno_suspicion, (CASE WHEN (ms.main_diagnosis_id IS NULL) THEN false ELSE true END), ((SubPlan 30)), md.disease_type_id, ((SubPlan 36)), ssrss.id, ((SubPlan 40)), ssr.id, (CASE WHEN (pv.initiator_id = 2) THEN true ELSE false END), ssr.customer_id, ((SubPlan 41)), ($69), ((SubPlan 49)), r.id, (NULL::unknown), ($85), ref_org.id, (COALESCE(ref_org.short_name, ref_org.full_name)), ref_dep.id, ref_dep.name, r.ref_doctor_id, ((SubPlan 52)), ref_diag.id, ((((ref_diag.code)::text || ' '::text) || (ref_diag.name)::text)), r.order_number, r.referral_date, r.diagnosis_comment, ma.id, ss.is_house_call, ssr.res_group_id, (CASE WHEN (ma.executor_id IS NULL) THEN ('employeeId='::text || ((SubPlan 53))::text) ELSE ('appointment.resourceGroupId='::text || (ma.executor_id)::text) END), ssr.id, ssr.org_id, ssr.customer_id, ssr.res_group_id, ((SubPlan 54)), ma.service_id, ms.id, (CASE WHEN (ma.id IS NULL) THEN ''::text ELSE ('ticket_id='::text || (ma.id)::text) END), ((SubPlan 55)), ((SubPlan 57)), (CASE WHEN (mc.closing_step_id IS NULL) THEN false ELSE true END), (1805760), (NULL::unknown), ((SubPlan 59)), ((SubPlan 61)), ((SubPlan 63)), ssr.customer_id, (1805760), (78020), ($107), (NULL::unknown), ssr.org_id, (CASE WHEN ((SubPlan 65) > 0) THEN true ELSE false END), pv.dental_formula_id, ((SubPlan 66)), (CASE WHEN (ssrss.id IS NULL) THEN CASE WHEN ($111 > 1) THEN false ELSE CASE WHEN ($113 > 1) THEN false ELSE $116 END END ELSE ssrss.is_stomat END), (CASE WHEN (pv.dental_formula_id IS NOT NULL) THEN true ELSE false END), ((alternatives: SubPlan 72 or hashed SubPlan 73)), mc.rankin_scale_for_admission_id, (CASE WHEN (ma.id IS NULL) THEN now() ELSE (ma.bdatetime)::timestamp with time zone END), ($121), ($124), (COALESCE($127, $128)), ($131), ($134), ($138), ($141), ($144), ($148), (COALESCE($151, $152)), ($156), ($160), ((SubPlan 94)), ($174), (NULL::unknown), ((SubPlan 98)), ((SubPlan 99)), pv.goal_id, (CASE WHEN (mc.main_diagnos_id = (SubPlan 100)) THEN true ELSE false END), (COALESCE((('№'::text || (mc.uid)::text) || ','::text), ''::text)), ((SubPlan 101)), ((SubPlan 108)), ((SubPlan 115))
  • Buffers: shared hit=211900
2.          

Initplan (for Limit)

3. 0.001 0.053 ↓ 0.0 0 1

Bitmap Heap Scan on public.cmn_setting_value (cost=4.43..15.66 rows=3 width=73) (actual time=0.053..0.053 rows=0 loops=1)

  • Output: cmn_setting_value.value
  • Recheck Cond: ((cmn_setting_value.setting_id)::text = 'cz.atria.md.base.api.service.prescription.ExternalPrescriptionsSettings.receiptsPromedButton'::text)
  • Buffers: shared hit=3
4. 0.052 0.052 ↓ 0.0 0 1

Bitmap Index Scan on cmn_setting_value_setting_id_idx (cost=0.00..4.43 rows=3 width=0) (actual time=0.052..0.052 rows=0 loops=1)

  • Index Cond: ((cmn_setting_value.setting_id)::text = 'cz.atria.md.base.api.service.prescription.ExternalPrescriptionsSettings.receiptsPromedButton'::text)
  • Buffers: shared hit=3
5. 0.012 0.012 ↑ 1.0 1 1

Index Scan using pim_department_pk on public.pim_department pd (cost=0.28..8.30 rows=1 width=4) (actual time=0.012..0.012 rows=1 loops=1)

  • Output: pd.is_social_significant
  • Index Cond: (pd.id = 7674)
  • Buffers: shared hit=3
6. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=453.09..453.10 rows=1 width=0) (never executed)

  • Output: count(*)
7. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on public.sr_res_group srg (cost=445.07..453.09 rows=2 width=0) (never executed)

  • Output: srg.id, srg.bdate, srg.edate, srg.is_system, srg.name, srg.department_id, srg.org_id, srg.responsible_id, srg.is_available_in_electronic_queue, srg.label_id, srg.ignore_regclinic_check, srg.note, srg.blocked, srg.block_comment, srg.template_res_group_id, srg.aud_who, srg.aud_when, srg.aud_source, srg.aud_who_create, srg.aud_when_create, srg.aud_source_create, srg.emergency, srg.ignore_districts, srg.service_template_id
  • Recheck Cond: ((NOT srg.is_system) AND (srg.responsible_id = 78020))
8. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=445.07..445.07 rows=2 width=0) (never executed)

9. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_id_is_system_ix (cost=0.00..190.69 rows=11,681 width=0) (never executed)

10. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_responsible_id_id_ix (cost=0.00..254.13 rows=13,008 width=0) (never executed)

  • Index Cond: (srg.responsible_id = 78020)
11. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=461.39..461.40 rows=1 width=93) (never executed)

  • Output: count(srgp_1.*)
12.          

Initplan (for Aggregate)

13. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on public.sr_res_group srg_1 (cost=445.07..453.09 rows=2 width=4) (never executed)

  • Output: srg_1.id
  • Recheck Cond: ((NOT srg_1.is_system) AND (srg_1.responsible_id = 78020))
14. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=445.07..445.07 rows=2 width=0) (never executed)

15. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_id_is_system_ix (cost=0.00..190.69 rows=11,681 width=0) (never executed)

16. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_responsible_id_id_ix (cost=0.00..254.13 rows=13,008 width=0) (never executed)

  • Index Cond: (srg_1.responsible_id = 78020)
17. 0.000 0.000 ↓ 0.0 0

Index Scan using sr_res_group_profile_res_group_id_idx on public.sr_res_group_profile srgp_1 (cost=0.29..8.30 rows=1 width=93) (never executed)

  • Output: srgp_1.*
  • Index Cond: (srgp_1.res_group_id = $35)
18. 0.000 0.000 ↓ 0.0 0

Index Scan using sr_res_group_profile_res_group_id_idx on public.sr_res_group_profile srgp_2 (cost=453.37..461.39 rows=1 width=4) (never executed)

  • Output: srgp_2.profile_id
  • Index Cond: (srgp_2.res_group_id = $37)
19.          

Initplan (for Index Scan)

20. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on public.sr_res_group srg_2 (cost=445.07..453.09 rows=2 width=4) (never executed)

  • Output: srg_2.id
  • Recheck Cond: ((NOT srg_2.is_system) AND (srg_2.responsible_id = 78020))
21. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=445.07..445.07 rows=2 width=0) (never executed)

22. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_id_is_system_ix (cost=0.00..190.69 rows=11,681 width=0) (never executed)

23. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_responsible_id_id_ix (cost=0.00..254.13 rows=13,008 width=0) (never executed)

  • Index Cond: (srg_2.responsible_id = 78020)
24. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=453.09..453.10 rows=1 width=0) (never executed)

  • Output: count(*)
25. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on public.sr_res_group srg_3 (cost=445.07..453.09 rows=2 width=0) (never executed)

  • Output: srg_3.id, srg_3.bdate, srg_3.edate, srg_3.is_system, srg_3.name, srg_3.department_id, srg_3.org_id, srg_3.responsible_id, srg_3.is_available_in_electronic_queue, srg_3.label_id, srg_3.ignore_regclinic_check, srg_3.note, srg_3.blocked, srg_3.block_comment, srg_3.template_res_group_id, srg_3.aud_who, srg_3.aud_when, srg_3.aud_source, srg_3.aud_who_create, srg_3.aud_when_create, srg_3.aud_source_create, srg_3.emergency, srg_3.ignore_districts, srg_3.service_template_id
  • Recheck Cond: ((NOT srg_3.is_system) AND (srg_3.responsible_id = 78020))
26. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=445.07..445.07 rows=2 width=0) (never executed)

27. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_id_is_system_ix (cost=0.00..190.69 rows=11,681 width=0) (never executed)

28. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_responsible_id_id_ix (cost=0.00..254.13 rows=13,008 width=0) (never executed)

  • Index Cond: (srg_3.responsible_id = 78020)
29. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=461.39..461.40 rows=1 width=93) (never executed)

  • Output: count(srgp_3.*)
30.          

Initplan (for Aggregate)

31. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on public.sr_res_group srg_4 (cost=445.07..453.09 rows=2 width=4) (never executed)

  • Output: srg_4.id
  • Recheck Cond: ((NOT srg_4.is_system) AND (srg_4.responsible_id = 78020))
32. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=445.07..445.07 rows=2 width=0) (never executed)

33. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_id_is_system_ix (cost=0.00..190.69 rows=11,681 width=0) (never executed)

34. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_responsible_id_id_ix (cost=0.00..254.13 rows=13,008 width=0) (never executed)

  • Index Cond: (srg_4.responsible_id = 78020)
35. 0.000 0.000 ↓ 0.0 0

Index Scan using sr_res_group_profile_res_group_id_idx on public.sr_res_group_profile srgp_3 (cost=0.29..8.30 rows=1 width=93) (never executed)

  • Output: srgp_3.*
  • Index Cond: (srgp_3.res_group_id = $40)
36. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=469.87..471.24 rows=2 width=64) (never executed)

  • Output: mp1.name
37. 0.000 0.000 ↓ 0.0 0

Unique (cost=469.72..469.73 rows=2 width=4) (never executed)

  • Output: srgp_4.profile_id
38. 0.000 0.000 ↓ 0.0 0

Sort (cost=469.72..469.73 rows=2 width=4) (never executed)

  • Output: srgp_4.profile_id
  • Sort Key: srgp_4.profile_id
39. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=445.35..469.71 rows=2 width=4) (never executed)

  • Output: srgp_4.profile_id
40. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on public.sr_res_group srg_5 (cost=445.07..453.09 rows=2 width=4) (never executed)

  • Output: srg_5.id, srg_5.bdate, srg_5.edate, srg_5.is_system, srg_5.name, srg_5.department_id, srg_5.org_id, srg_5.responsible_id, srg_5.is_available_in_electronic_queue, srg_5.label_id, srg_5.ignore_regclinic_check, srg_5.note, srg_5.blocked, srg_5.block_comment, srg_5.template_res_group_id, srg_5.aud_who, srg_5.aud_when, srg_5.aud_source, srg_5.aud_who_create, srg_5.aud_when_create, srg_5.aud_source_create, srg_5.emergency, srg_5.ignore_districts, srg_5.service_template_id
  • Recheck Cond: ((NOT srg_5.is_system) AND (srg_5.responsible_id = 78020))
41. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=445.07..445.07 rows=2 width=0) (never executed)

42. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_id_is_system_ix (cost=0.00..190.69 rows=11,681 width=0) (never executed)

43. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_responsible_id_id_ix (cost=0.00..254.13 rows=13,008 width=0) (never executed)

  • Index Cond: (srg_5.responsible_id = 78020)
44. 0.000 0.000 ↓ 0.0 0

Index Scan using sr_res_group_profile_res_group_id_idx on public.sr_res_group_profile srgp_4 (cost=0.29..8.30 rows=1 width=8) (never executed)

  • Output: srgp_4.id, srgp_4.res_group_id, srgp_4.profile_id, srgp_4.aud_who, srgp_4.aud_when, srgp_4.aud_source, srgp_4.aud_who_create, srgp_4.aud_when_create, srgp_4.aud_source_create
  • Index Cond: (srgp_4.res_group_id = srg_5.id)
45. 0.000 0.000 ↓ 0.0 0

Index Scan using md_profile_pk on public.md_profile mp1 (cost=0.14..0.74 rows=1 width=68) (never executed)

  • Output: mp1.id, mp1.code, mp1.genitive_name, mp1.name, mp1.e_code, mp1.aud_who, mp1.aud_when, mp1.aud_source, mp1.aud_who_create, mp1.aud_when_create, mp1.aud_source_create, mp1.from_dt, mp1.to_dt, mp1.billing_code
  • Index Cond: (mp1.id = srgp_4.profile_id)
46. 0.023 0.023 ↑ 1.0 1 1

Index Scan using md_clinic_pk on public.md_clinic (cost=0.14..8.16 rows=1 width=1) (actual time=0.023..0.023 rows=1 loops=1)

  • Output: md_clinic.priv_rec_for_unreg_pat
  • Index Cond: (md_clinic.id = 1805760)
  • Buffers: shared hit=2
47. 0.003 0.025 ↑ 1.0 1 1

Limit (cost=0.00..2.38 rows=1 width=4) (actual time=0.025..0.025 rows=1 loops=1)

  • Output: md_referral_type.id
  • Buffers: shared hit=1
48. 0.022 0.022 ↑ 1.0 1 1

Seq Scan on public.md_referral_type (cost=0.00..2.38 rows=1 width=4) (actual time=0.022..0.022 rows=1 loops=1)

  • Output: md_referral_type.id
  • Filter: ((md_referral_type.code)::text = '3'::text)
  • Buffers: shared hit=1
49. 0.010 0.010 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.010..0.010 rows=1 loops=1)

  • Output: now()
50. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=453.09..453.10 rows=1 width=0) (never executed)

  • Output: count(*)
51. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on public.sr_res_group srg_10 (cost=445.07..453.09 rows=2 width=0) (never executed)

  • Output: srg_10.id, srg_10.bdate, srg_10.edate, srg_10.is_system, srg_10.name, srg_10.department_id, srg_10.org_id, srg_10.responsible_id, srg_10.is_available_in_electronic_queue, srg_10.label_id, srg_10.ignore_regclinic_check, srg_10.note, srg_10.blocked, srg_10.block_comment, srg_10.template_res_group_id, srg_10.aud_who, srg_10.aud_when, srg_10.aud_source, srg_10.aud_who_create, srg_10.aud_when_create, srg_10.aud_source_create, srg_10.emergency, srg_10.ignore_districts, srg_10.service_template_id
  • Recheck Cond: ((NOT srg_10.is_system) AND (srg_10.responsible_id = 78020))
52. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=445.07..445.07 rows=2 width=0) (never executed)

53. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_id_is_system_ix (cost=0.00..190.69 rows=11,681 width=0) (never executed)

54. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_responsible_id_id_ix (cost=0.00..254.13 rows=13,008 width=0) (never executed)

  • Index Cond: (srg_10.responsible_id = 78020)
55. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=484.31..484.32 rows=1 width=96) (never executed)

  • Output: count(srgs_2.*)
56.          

Initplan (for Aggregate)

57. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on public.sr_res_group srg_11 (cost=445.07..453.09 rows=2 width=4) (never executed)

  • Output: srg_11.id
  • Recheck Cond: ((NOT srg_11.is_system) AND (srg_11.responsible_id = 78020))
58. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=445.07..445.07 rows=2 width=0) (never executed)

59. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_id_is_system_ix (cost=0.00..190.69 rows=11,681 width=0) (never executed)

60. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_responsible_id_id_ix (cost=0.00..254.13 rows=13,008 width=0) (never executed)

  • Index Cond: (srg_11.responsible_id = 78020)
61. 0.000 0.000 ↓ 0.0 0

Index Scan using sr_res_group_service_group_id_idx on public.sr_res_group_service srgs_2 (cost=0.43..31.22 rows=2 width=96) (never executed)

  • Output: srgs_2.*
  • Index Cond: (srgs_2.group_id = $112)
  • Filter: srgs_2.default_service
62. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=484.73..492.77 rows=2 width=1) (never executed)

  • Output: sr_service_2.is_stomat
63.          

Initplan (for Nested Loop)

64. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on public.sr_res_group srg_12 (cost=445.07..453.09 rows=2 width=4) (never executed)

  • Output: srg_12.id
  • Recheck Cond: ((NOT srg_12.is_system) AND (srg_12.responsible_id = 78020))
65. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=445.07..445.07 rows=2 width=0) (never executed)

66. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_id_is_system_ix (cost=0.00..190.69 rows=11,681 width=0) (never executed)

67. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_responsible_id_id_ix (cost=0.00..254.13 rows=13,008 width=0) (never executed)

  • Index Cond: (srg_12.responsible_id = 78020)
68. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=31.23..31.24 rows=1 width=4) (never executed)

  • Output: srgs_3.srv_type_id
  • Group Key: srgs_3.srv_type_id
69. 0.000 0.000 ↓ 0.0 0

Index Scan using sr_res_group_service_group_id_idx on public.sr_res_group_service srgs_3 (cost=0.43..31.22 rows=2 width=4) (never executed)

  • Output: srgs_3.id, srgs_3.bdatetime, srgs_3.edatetime, srgs_3.power, srgs_3.group_id, srgs_3.srv_type_id, srgs_3.moderation_required, srgs_3.patient_multiple_appointment_per_day, srgs_3.referral_required, srgs_3.default_service, srgs_3.aud_who, srgs_3.aud_when, srgs_3.aud_source, srgs_3.aud_who_create, srgs_3.aud_when_create, srgs_3.aud_source_create
  • Index Cond: (srgs_3.group_id = $114)
  • Filter: srgs_3.default_service
70. 0.000 0.000 ↓ 0.0 0

Index Scan using sr_service_pk on public.sr_service sr_service_2 (cost=0.42..8.44 rows=1 width=5) (never executed)

  • Output: sr_service_2.id, sr_service_2.code, sr_service_2.cul, sr_service_2.is_death, sr_service_2.duration, sr_service_2.is_fictitious, sr_service_2.is_independent, sr_service_2.is_multuplicity, sr_service_2.name, sr_service_2.terms, sr_service_2.org_id, sr_service_2.category_id, sr_service_2.duration_unit_id, sr_service_2.prototype_id, sr_service_2.type_id, sr_service_2.from_dt, sr_service_2.to_dt, sr_service_2.is_repeated, sr_service_2.is_inherit_protocol, sr_service_2.is_expendable_materials, sr_service_2.is_actual_cul, sr_service_2.is_paraclinical, sr_service_2.is_complex, sr_service_2.accounting_id, sr_service_2.is_fact, sr_service_2.is_autocopy_diagnoses, sr_service_2.is_stomat, sr_service_2.srg_dif_type_id, sr_service_2.srg_opr_kind_id, sr_service_2.is_need_anatomic_zone, sr_service_2.aud_who, sr_service_2.aud_when, sr_service_2.aud_source, sr_service_2.aud_who_create, sr_service_2.aud_when_create, sr_service_2.aud_source_create, sr_service_2.is_filling, sr_service_2.is_extraction, sr_service_2.is_need_close_date, sr_service_2.is_vmp, sr_service_2.short_name
  • Index Cond: (sr_service_2.id = srgs_3.srv_type_id)
71. 0.147 1.722 ↑ 4.0 1 1

Nested Loop Semi Join (cost=4.58..296.16 rows=4 width=33) (actual time=1.715..1.722 rows=1 loops=1)

  • Output: row_to_json(ROW(fin_funding_source_type.id, fin_funding_source_type.name))
  • Join Filter: (fin_funding_source_type.id = (((((t.fields_model)::json -> 'mcCase'::text) -> 'fundingSourceType'::text) ->> 'id'::text))::integer)
  • Rows Removed by Join Filter: 7
  • Buffers: shared hit=194
72. 0.015 0.015 ↑ 1.0 8 1

Seq Scan on public.fin_funding_source_type (cost=0.00..1.08 rows=8 width=33) (actual time=0.013..0.015 rows=8 loops=1)

  • Output: fin_funding_source_type.id, fin_funding_source_type.bdate, fin_funding_source_type.code, fin_funding_source_type.edate, fin_funding_source_type.name, fin_funding_source_type.ordern, fin_funding_source_type.parent_id, fin_funding_source_type.has_exception, fin_funding_source_type.e_code, fin_funding_source_type.is_contract_required, fin_funding_source_type.is_citizen, fin_funding_source_type.is_payer_smo, fin_funding_source_type.is_payer_foms, fin_funding_source_type.is_default, fin_funding_source_type.is_privileged, fin_funding_source_type.aud_who, fin_funding_source_type.aud_when, fin_funding_source_type.aud_source, fin_funding_source_type.aud_who_create, fin_funding_source_type.aud_when_create, fin_funding_source_type.aud_source_create, fin_funding_source_type.from_dt, fin_funding_source_type.to_dt, fin_funding_source_type.is_vmp, fin_funding_source_type.billing_code
  • Buffers: shared hit=1
73. 0.008 1.560 ↑ 1.0 1 8

Materialize (cost=4.58..294.81 rows=1 width=111) (actual time=0.118..0.195 rows=1 loops=8)

  • Output: t.fields_model
  • Buffers: shared hit=193
74. 0.043 1.552 ↑ 1.0 1 1

Nested Loop (cost=4.58..294.81 rows=1 width=111) (actual time=0.935..1.552 rows=1 loops=1)

  • Output: t.fields_model
  • Buffers: shared hit=193
75. 0.055 1.455 ↑ 1.0 1 1

Nested Loop (cost=4.30..294.36 rows=1 width=4) (actual time=0.840..1.455 rows=1 loops=1)

  • Output: tak.template_id
  • Buffers: shared hit=190
76. 1.361 1.361 ↑ 1.0 1 1

Seq Scan on sec.access_key ak (cost=0.00..283.33 rows=1 width=4) (actual time=0.746..1.361 rows=1 loops=1)

  • Output: ak.id, ak.type_id, ak.org_id, ak.empl_pos_id, ak.user_id, ak.name, ak.is_blocked, ak.aud_who, ak.aud_when, ak.aud_source, ak.aud_who_create, ak.aud_when_create, ak.aud_source_create
  • Filter: ((ak.empl_pos_id = 78020) AND (ak.org_id = 1805760))
  • Rows Removed by Filter: 6394
  • Buffers: shared hit=187
77. 0.027 0.039 ↑ 2.0 1 1

Bitmap Heap Scan on def.template_access_key tak (cost=4.30..11.01 rows=2 width=8) (actual time=0.039..0.039 rows=1 loops=1)

  • Output: tak.id, tak.template_id, tak.access_key_id, tak.is_primary, tak.is_author, tak.aud_who, tak.aud_when, tak.aud_source, tak.aud_who_create, tak.aud_when_create, tak.aud_source_create
  • Recheck Cond: (tak.access_key_id = ak.id)
  • Heap Blocks: exact=1
  • Buffers: shared hit=3
78. 0.012 0.012 ↑ 2.0 1 1

Bitmap Index Scan on idx_template_access_key_access_key_di (cost=0.00..4.29 rows=2 width=0) (actual time=0.012..0.012 rows=1 loops=1)

  • Index Cond: (tak.access_key_id = ak.id)
  • Buffers: shared hit=2
79. 0.054 0.054 ↑ 1.0 1 1

Index Scan using pk_template on def.template t (cost=0.28..0.43 rows=1 width=115) (actual time=0.053..0.054 rows=1 loops=1)

  • Output: t.id, t.name, t.page_id, t.container_id, t.widget_id, t.fields_model, t.filters_model, t.aud_who, t.aud_when, t.aud_source, t.aud_who_create, t.aud_when_create, t.aud_source_create
  • Index Cond: (t.id = tak.template_id)
  • Filter: ((t.page_id = 'resultAdmissionMain'::text) AND (t.container_id = 'admissionCase'::text))
  • Buffers: shared hit=3
80. 0.109 1.121 ↑ 3.0 1 1

Nested Loop Semi Join (cost=4.58..296.07 rows=3 width=59) (actual time=1.109..1.121 rows=1 loops=1)

  • Output: row_to_json(ROW(mc_case_type.id, mc_case_type.name))
  • Join Filter: (mc_case_type.id = (((((t_1.fields_model)::json -> 'mcCase'::text) -> 'caseType'::text) ->> 'id'::text))::integer)
  • Rows Removed by Join Filter: 5
  • Buffers: shared hit=194
81. 0.016 0.016 ↑ 1.0 6 1

Seq Scan on public.mc_case_type (cost=0.00..1.06 rows=6 width=59) (actual time=0.016..0.016 rows=6 loops=1)

  • Output: mc_case_type.id, mc_case_type.case_mode_id, mc_case_type.code, mc_case_type.name, mc_case_type.default_regimen_id, mc_case_type.e_code, mc_case_type.aud_who, mc_case_type.aud_when, mc_case_type.aud_source, mc_case_type.aud_who_create, mc_case_type.aud_when_create, mc_case_type.aud_source_create, mc_case_type.from_dt, mc_case_type.to_dt, mc_case_type.billing_code
  • Buffers: shared hit=1
82. 0.006 0.996 ↑ 1.0 1 6

Materialize (cost=4.58..294.81 rows=1 width=111) (actual time=0.099..0.166 rows=1 loops=6)

  • Output: t_1.fields_model
  • Buffers: shared hit=193
83. 0.052 0.990 ↑ 1.0 1 1

Nested Loop (cost=4.58..294.81 rows=1 width=111) (actual time=0.589..0.990 rows=1 loops=1)

  • Output: t_1.fields_model
  • Buffers: shared hit=193
84. 0.028 0.909 ↑ 1.0 1 1

Nested Loop (cost=4.30..294.36 rows=1 width=4) (actual time=0.510..0.909 rows=1 loops=1)

  • Output: tak_1.template_id
  • Buffers: shared hit=190
85. 0.840 0.840 ↑ 1.0 1 1

Seq Scan on sec.access_key ak_1 (cost=0.00..283.33 rows=1 width=4) (actual time=0.442..0.840 rows=1 loops=1)

  • Output: ak_1.id, ak_1.type_id, ak_1.org_id, ak_1.empl_pos_id, ak_1.user_id, ak_1.name, ak_1.is_blocked, ak_1.aud_who, ak_1.aud_when, ak_1.aud_source, ak_1.aud_who_create, ak_1.aud_when_create, ak_1.aud_source_create
  • Filter: ((ak_1.empl_pos_id = 78020) AND (ak_1.org_id = 1805760))
  • Rows Removed by Filter: 6394
  • Buffers: shared hit=187
86. 0.036 0.041 ↑ 2.0 1 1

Bitmap Heap Scan on def.template_access_key tak_1 (cost=4.30..11.01 rows=2 width=8) (actual time=0.040..0.041 rows=1 loops=1)

  • Output: tak_1.id, tak_1.template_id, tak_1.access_key_id, tak_1.is_primary, tak_1.is_author, tak_1.aud_who, tak_1.aud_when, tak_1.aud_source, tak_1.aud_who_create, tak_1.aud_when_create, tak_1.aud_source_create
  • Recheck Cond: (tak_1.access_key_id = ak_1.id)
  • Heap Blocks: exact=1
  • Buffers: shared hit=3
87. 0.005 0.005 ↑ 2.0 1 1

Bitmap Index Scan on idx_template_access_key_access_key_di (cost=0.00..4.29 rows=2 width=0) (actual time=0.005..0.005 rows=1 loops=1)

  • Index Cond: (tak_1.access_key_id = ak_1.id)
  • Buffers: shared hit=2
88. 0.029 0.029 ↑ 1.0 1 1

Index Scan using pk_template on def.template t_1 (cost=0.28..0.43 rows=1 width=115) (actual time=0.028..0.029 rows=1 loops=1)

  • Output: t_1.id, t_1.name, t_1.page_id, t_1.container_id, t_1.widget_id, t_1.fields_model, t_1.filters_model, t_1.aud_who, t_1.aud_when, t_1.aud_source, t_1.aud_who_create, t_1.aud_when_create, t_1.aud_source_create
  • Index Cond: (t_1.id = tak_1.template_id)
  • Filter: ((t_1.page_id = 'resultAdmissionMain'::text) AND (t_1.container_id = 'admissionCase'::text))
  • Buffers: shared hit=3
89. 0.092 1.104 ↓ 0.0 0 1

Nested Loop Semi Join (cost=4.58..296.12 rows=4 width=45) (actual time=1.104..1.104 rows=0 loops=1)

  • Output: row_to_json(ROW(mc_care_regimen.id, mc_care_regimen.name))
  • Join Filter: (mc_care_regimen.id = (((((t_2.fields_model)::json -> 'mcCase'::text) -> 'mcCaseCareRegimen'::text) ->> 'id'::text))::integer)
  • Rows Removed by Join Filter: 7
  • Buffers: shared hit=194
90. 0.018 0.018 ↑ 1.0 7 1

Seq Scan on public.mc_care_regimen (cost=0.00..1.07 rows=7 width=45) (actual time=0.016..0.018 rows=7 loops=1)

  • Output: mc_care_regimen.id, mc_care_regimen.bdate, mc_care_regimen.is_bed_required, mc_care_regimen.case_mode_id, mc_care_regimen.med_cert_name, mc_care_regimen.code, mc_care_regimen.edate, mc_care_regimen.name, mc_care_regimen.e_code, mc_care_regimen.aud_who, mc_care_regimen.aud_when, mc_care_regimen.aud_source, mc_care_regimen.aud_who_create, mc_care_regimen.aud_when_create, mc_care_regimen.aud_source_create, mc_care_regimen.from_dt, mc_care_regimen.to_dt, mc_care_regimen.is_not_admission, mc_care_regimen.billing_code
  • Buffers: shared hit=1
91. 0.003 0.994 ↑ 1.0 1 7

Materialize (cost=4.58..294.81 rows=1 width=111) (actual time=0.086..0.142 rows=1 loops=7)

  • Output: t_2.fields_model
  • Buffers: shared hit=193
92. 0.051 0.991 ↑ 1.0 1 1

Nested Loop (cost=4.58..294.81 rows=1 width=111) (actual time=0.593..0.991 rows=1 loops=1)

  • Output: t_2.fields_model
  • Buffers: shared hit=193
93. 0.042 0.911 ↑ 1.0 1 1

Nested Loop (cost=4.30..294.36 rows=1 width=4) (actual time=0.514..0.911 rows=1 loops=1)

  • Output: tak_2.template_id
  • Buffers: shared hit=190
94. 0.841 0.841 ↑ 1.0 1 1

Seq Scan on sec.access_key ak_2 (cost=0.00..283.33 rows=1 width=4) (actual time=0.446..0.841 rows=1 loops=1)

  • Output: ak_2.id, ak_2.type_id, ak_2.org_id, ak_2.empl_pos_id, ak_2.user_id, ak_2.name, ak_2.is_blocked, ak_2.aud_who, ak_2.aud_when, ak_2.aud_source, ak_2.aud_who_create, ak_2.aud_when_create, ak_2.aud_source_create
  • Filter: ((ak_2.empl_pos_id = 78020) AND (ak_2.org_id = 1805760))
  • Rows Removed by Filter: 6394
  • Buffers: shared hit=187
95. 0.023 0.028 ↑ 2.0 1 1

Bitmap Heap Scan on def.template_access_key tak_2 (cost=4.30..11.01 rows=2 width=8) (actual time=0.028..0.028 rows=1 loops=1)

  • Output: tak_2.id, tak_2.template_id, tak_2.access_key_id, tak_2.is_primary, tak_2.is_author, tak_2.aud_who, tak_2.aud_when, tak_2.aud_source, tak_2.aud_who_create, tak_2.aud_when_create, tak_2.aud_source_create
  • Recheck Cond: (tak_2.access_key_id = ak_2.id)
  • Heap Blocks: exact=1
  • Buffers: shared hit=3
96. 0.005 0.005 ↑ 2.0 1 1

Bitmap Index Scan on idx_template_access_key_access_key_di (cost=0.00..4.29 rows=2 width=0) (actual time=0.005..0.005 rows=1 loops=1)

  • Index Cond: (tak_2.access_key_id = ak_2.id)
  • Buffers: shared hit=2
97. 0.029 0.029 ↑ 1.0 1 1

Index Scan using pk_template on def.template t_2 (cost=0.28..0.43 rows=1 width=115) (actual time=0.028..0.029 rows=1 loops=1)

  • Output: t_2.id, t_2.name, t_2.page_id, t_2.container_id, t_2.widget_id, t_2.fields_model, t_2.filters_model, t_2.aud_who, t_2.aud_when, t_2.aud_source, t_2.aud_who_create, t_2.aud_when_create, t_2.aud_source_create
  • Index Cond: (t_2.id = tak_2.template_id)
  • Filter: ((t_2.page_id = 'resultAdmissionMain'::text) AND (t_2.container_id = 'admissionCase'::text))
  • Buffers: shared hit=3
98. 0.120 0.140 ↑ 1.0 1 1

Subquery Scan on r_1 (cost=0.00..1.10 rows=1 width=69) (actual time=0.139..0.140 rows=1 loops=1)

  • Output: row_to_json(r_1.*)
  • Buffers: shared hit=1
99. 0.002 0.020 ↑ 1.0 1 1

Limit (cost=0.00..1.09 rows=1 width=45) (actual time=0.020..0.020 rows=1 loops=1)

  • Output: mcrd.id, mcrd.name
  • Buffers: shared hit=1
100. 0.018 0.018 ↑ 1.0 1 1

Seq Scan on public.mc_care_regimen mcrd (cost=0.00..1.09 rows=1 width=45) (actual time=0.018..0.018 rows=1 loops=1)

  • Output: mcrd.id, mcrd.name
  • Filter: (mcrd.code = 1)
  • Buffers: shared hit=1
101. 0.131 1.131 ↓ 0.0 0 1

Nested Loop Semi Join (cost=4.58..296.29 rows=6 width=77) (actual time=1.131..1.131 rows=0 loops=1)

  • Output: row_to_json(ROW(mc_care_level.id, mc_care_level.name))
  • Join Filter: (mc_care_level.id = (((((t_3.fields_model)::json -> 'mcCase'::text) -> 'careLevel'::text) ->> 'id'::text))::integer)
  • Rows Removed by Join Filter: 11
  • Buffers: shared hit=194
102. 0.010 0.010 ↑ 1.0 11 1

Seq Scan on public.mc_care_level (cost=0.00..1.11 rows=11 width=77) (actual time=0.008..0.010 rows=11 loops=1)

  • Output: mc_care_level.id, mc_care_level.bdate, mc_care_level.code, mc_care_level.edate, mc_care_level.name, mc_care_level.e_code, mc_care_level.vmp_flag, mc_care_level.icon_code, mc_care_level.parent_id, mc_care_level.aud_who, mc_care_level.aud_when, mc_care_level.aud_source, mc_care_level.aud_who_create, mc_care_level.aud_when_create, mc_care_level.aud_source_create, mc_care_level.from_dt, mc_care_level.to_dt, mc_care_level.billing_code
  • Buffers: shared hit=1
103. 0.007 0.990 ↑ 1.0 1 11

Materialize (cost=4.58..294.81 rows=1 width=111) (actual time=0.055..0.090 rows=1 loops=11)

  • Output: t_3.fields_model
  • Buffers: shared hit=193
104. 0.044 0.983 ↑ 1.0 1 1

Nested Loop (cost=4.58..294.81 rows=1 width=111) (actual time=0.599..0.983 rows=1 loops=1)

  • Output: t_3.fields_model
  • Buffers: shared hit=193
105. 0.037 0.900 ↑ 1.0 1 1

Nested Loop (cost=4.30..294.36 rows=1 width=4) (actual time=0.517..0.900 rows=1 loops=1)

  • Output: tak_3.template_id
  • Buffers: shared hit=190
106. 0.830 0.830 ↑ 1.0 1 1

Seq Scan on sec.access_key ak_3 (cost=0.00..283.33 rows=1 width=4) (actual time=0.449..0.830 rows=1 loops=1)

  • Output: ak_3.id, ak_3.type_id, ak_3.org_id, ak_3.empl_pos_id, ak_3.user_id, ak_3.name, ak_3.is_blocked, ak_3.aud_who, ak_3.aud_when, ak_3.aud_source, ak_3.aud_who_create, ak_3.aud_when_create, ak_3.aud_source_create
  • Filter: ((ak_3.empl_pos_id = 78020) AND (ak_3.org_id = 1805760))
  • Rows Removed by Filter: 6394
  • Buffers: shared hit=187
107. 0.028 0.033 ↑ 2.0 1 1

Bitmap Heap Scan on def.template_access_key tak_3 (cost=4.30..11.01 rows=2 width=8) (actual time=0.033..0.033 rows=1 loops=1)

  • Output: tak_3.id, tak_3.template_id, tak_3.access_key_id, tak_3.is_primary, tak_3.is_author, tak_3.aud_who, tak_3.aud_when, tak_3.aud_source, tak_3.aud_who_create, tak_3.aud_when_create, tak_3.aud_source_create
  • Recheck Cond: (tak_3.access_key_id = ak_3.id)
  • Heap Blocks: exact=1
  • Buffers: shared hit=3
108. 0.005 0.005 ↑ 2.0 1 1

Bitmap Index Scan on idx_template_access_key_access_key_di (cost=0.00..4.29 rows=2 width=0) (actual time=0.005..0.005 rows=1 loops=1)

  • Index Cond: (tak_3.access_key_id = ak_3.id)
  • Buffers: shared hit=2
109. 0.039 0.039 ↑ 1.0 1 1

Index Scan using pk_template on def.template t_3 (cost=0.28..0.43 rows=1 width=115) (actual time=0.038..0.039 rows=1 loops=1)

  • Output: t_3.id, t_3.name, t_3.page_id, t_3.container_id, t_3.widget_id, t_3.fields_model, t_3.filters_model, t_3.aud_who, t_3.aud_when, t_3.aud_source, t_3.aud_who_create, t_3.aud_when_create, t_3.aud_source_create
  • Index Cond: (t_3.id = tak_3.template_id)
  • Filter: ((t_3.page_id = 'resultAdmissionMain'::text) AND (t_3.container_id = 'admissionCase'::text))
  • Buffers: shared hit=3
110. 0.089 1.089 ↓ 0.0 0 1

Nested Loop Semi Join (cost=4.58..296.12 rows=4 width=45) (actual time=1.089..1.089 rows=0 loops=1)

  • Output: row_to_json(ROW(mc_care_regimen_1.id, mc_care_regimen_1.name))
  • Join Filter: (mc_care_regimen_1.id = (((((t_4.fields_model)::json -> 'mcCase'::text) -> 'careRegimen'::text) ->> 'id'::text))::integer)
  • Rows Removed by Join Filter: 7
  • Buffers: shared hit=194
111. 0.013 0.013 ↑ 1.0 7 1

Seq Scan on public.mc_care_regimen mc_care_regimen_1 (cost=0.00..1.07 rows=7 width=45) (actual time=0.011..0.013 rows=7 loops=1)

  • Output: mc_care_regimen_1.id, mc_care_regimen_1.bdate, mc_care_regimen_1.is_bed_required, mc_care_regimen_1.case_mode_id, mc_care_regimen_1.med_cert_name, mc_care_regimen_1.code, mc_care_regimen_1.edate, mc_care_regimen_1.name, mc_care_regimen_1.e_code, mc_care_regimen_1.aud_who, mc_care_regimen_1.aud_when, mc_care_regimen_1.aud_source, mc_care_regimen_1.aud_who_create, mc_care_regimen_1.aud_when_create, mc_care_regimen_1.aud_source_create, mc_care_regimen_1.from_dt, mc_care_regimen_1.to_dt, mc_care_regimen_1.is_not_admission, mc_care_regimen_1.billing_code
  • Buffers: shared hit=1
112. 0.020 0.987 ↑ 1.0 1 7

Materialize (cost=4.58..294.81 rows=1 width=111) (actual time=0.086..0.141 rows=1 loops=7)

  • Output: t_4.fields_model
  • Buffers: shared hit=193
113. 0.026 0.967 ↑ 1.0 1 1

Nested Loop (cost=4.58..294.81 rows=1 width=111) (actual time=0.584..0.967 rows=1 loops=1)

  • Output: t_4.fields_model
  • Buffers: shared hit=193
114. 0.038 0.912 ↑ 1.0 1 1

Nested Loop (cost=4.30..294.36 rows=1 width=4) (actual time=0.530..0.912 rows=1 loops=1)

  • Output: tak_4.template_id
  • Buffers: shared hit=190
115. 0.842 0.842 ↑ 1.0 1 1

Seq Scan on sec.access_key ak_4 (cost=0.00..283.33 rows=1 width=4) (actual time=0.461..0.842 rows=1 loops=1)

  • Output: ak_4.id, ak_4.type_id, ak_4.org_id, ak_4.empl_pos_id, ak_4.user_id, ak_4.name, ak_4.is_blocked, ak_4.aud_who, ak_4.aud_when, ak_4.aud_source, ak_4.aud_who_create, ak_4.aud_when_create, ak_4.aud_source_create
  • Filter: ((ak_4.empl_pos_id = 78020) AND (ak_4.org_id = 1805760))
  • Rows Removed by Filter: 6394
  • Buffers: shared hit=187
116. 0.025 0.032 ↑ 2.0 1 1

Bitmap Heap Scan on def.template_access_key tak_4 (cost=4.30..11.01 rows=2 width=8) (actual time=0.031..0.032 rows=1 loops=1)

  • Output: tak_4.id, tak_4.template_id, tak_4.access_key_id, tak_4.is_primary, tak_4.is_author, tak_4.aud_who, tak_4.aud_when, tak_4.aud_source, tak_4.aud_who_create, tak_4.aud_when_create, tak_4.aud_source_create
  • Recheck Cond: (tak_4.access_key_id = ak_4.id)
  • Heap Blocks: exact=1
  • Buffers: shared hit=3
117. 0.007 0.007 ↑ 2.0 1 1

Bitmap Index Scan on idx_template_access_key_access_key_di (cost=0.00..4.29 rows=2 width=0) (actual time=0.007..0.007 rows=1 loops=1)

  • Index Cond: (tak_4.access_key_id = ak_4.id)
  • Buffers: shared hit=2
118. 0.029 0.029 ↑ 1.0 1 1

Index Scan using pk_template on def.template t_4 (cost=0.28..0.43 rows=1 width=115) (actual time=0.028..0.029 rows=1 loops=1)

  • Output: t_4.id, t_4.name, t_4.page_id, t_4.container_id, t_4.widget_id, t_4.fields_model, t_4.filters_model, t_4.aud_who, t_4.aud_when, t_4.aud_source, t_4.aud_who_create, t_4.aud_when_create, t_4.aud_source_create
  • Index Cond: (t_4.id = tak_4.template_id)
  • Filter: ((t_4.page_id = 'resultAdmissionMain'::text) AND (t_4.container_id = 'admissionCase'::text))
  • Buffers: shared hit=3
119. 0.094 1.177 ↑ 16.0 1 1

Nested Loop (cost=294.97..295.07 rows=16 width=80) (actual time=1.176..1.177 rows=1 loops=1)

  • Output: row_to_json(ROW(mc_case_init_goal.id, mc_case_init_goal.name))
  • Buffers: shared hit=195
120. 0.049 1.062 ↑ 1.0 1 1

HashAggregate (cost=294.81..294.82 rows=1 width=111) (actual time=1.062..1.062 rows=1 loops=1)

  • Output: t_5.fields_model
  • Group Key: (((((t_5.fields_model)::json -> 'mcCase'::text) -> 'caseInitGoal'::text) ->> 'id'::text))::integer
  • Buffers: shared hit=193
121. 0.079 1.013 ↑ 1.0 1 1

Nested Loop (cost=4.58..294.81 rows=1 width=111) (actual time=0.625..1.013 rows=1 loops=1)

  • Output: t_5.fields_model, (((((t_5.fields_model)::json -> 'mcCase'::text) -> 'caseInitGoal'::text) ->> 'id'::text))::integer
  • Buffers: shared hit=193
122. 0.030 0.905 ↑ 1.0 1 1

Nested Loop (cost=4.30..294.36 rows=1 width=4) (actual time=0.518..0.905 rows=1 loops=1)

  • Output: tak_5.template_id
  • Buffers: shared hit=190
123. 0.851 0.851 ↑ 1.0 1 1

Seq Scan on sec.access_key ak_5 (cost=0.00..283.33 rows=1 width=4) (actual time=0.465..0.851 rows=1 loops=1)

  • Output: ak_5.id, ak_5.type_id, ak_5.org_id, ak_5.empl_pos_id, ak_5.user_id, ak_5.name, ak_5.is_blocked, ak_5.aud_who, ak_5.aud_when, ak_5.aud_source, ak_5.aud_who_create, ak_5.aud_when_create, ak_5.aud_source_create
  • Filter: ((ak_5.empl_pos_id = 78020) AND (ak_5.org_id = 1805760))
  • Rows Removed by Filter: 6394
  • Buffers: shared hit=187
124. 0.019 0.024 ↑ 2.0 1 1

Bitmap Heap Scan on def.template_access_key tak_5 (cost=4.30..11.01 rows=2 width=8) (actual time=0.024..0.024 rows=1 loops=1)

  • Output: tak_5.id, tak_5.template_id, tak_5.access_key_id, tak_5.is_primary, tak_5.is_author, tak_5.aud_who, tak_5.aud_when, tak_5.aud_source, tak_5.aud_who_create, tak_5.aud_when_create, tak_5.aud_source_create
  • Recheck Cond: (tak_5.access_key_id = ak_5.id)
  • Heap Blocks: exact=1
  • Buffers: shared hit=3
125. 0.005 0.005 ↑ 2.0 1 1

Bitmap Index Scan on idx_template_access_key_access_key_di (cost=0.00..4.29 rows=2 width=0) (actual time=0.005..0.005 rows=1 loops=1)

  • Index Cond: (tak_5.access_key_id = ak_5.id)
  • Buffers: shared hit=2
126. 0.029 0.029 ↑ 1.0 1 1

Index Scan using pk_template on def.template t_5 (cost=0.28..0.43 rows=1 width=115) (actual time=0.028..0.029 rows=1 loops=1)

  • Output: t_5.id, t_5.name, t_5.page_id, t_5.container_id, t_5.widget_id, t_5.fields_model, t_5.filters_model, t_5.aud_who, t_5.aud_when, t_5.aud_source, t_5.aud_who_create, t_5.aud_when_create, t_5.aud_source_create
  • Index Cond: (t_5.id = tak_5.template_id)
  • Filter: ((t_5.page_id = 'resultAdmissionMain'::text) AND (t_5.container_id = 'admissionCase'::text))
  • Buffers: shared hit=3
127. 0.021 0.021 ↑ 1.0 1 1

Index Scan using mc_case_init_goal_pk on public.mc_case_init_goal (cost=0.16..0.20 rows=1 width=80) (actual time=0.020..0.021 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, mc_case_init_goal.billing_code
  • Index Cond: (mc_case_init_goal.id = (((((t_5.fields_model)::json -> 'mcCase'::text) -> 'caseInitGoal'::text) ->> 'id'::text))::integer)
  • Buffers: shared hit=2
128. 0.086 1.095 ↑ 2.0 1 1

Nested Loop Semi Join (cost=4.58..295.94 rows=2 width=23) (actual time=1.094..1.095 rows=1 loops=1)

  • Output: row_to_json(ROW(md_care_providing_form.id, md_care_providing_form.name))
  • Join Filter: (md_care_providing_form.id = (((((t_6.fields_model)::json -> 'mcCase'::text) -> 'careProvidingForm'::text) ->> 'id'::text))::integer)
  • Rows Removed by Join Filter: 2
  • Buffers: shared hit=194
129. 0.007 0.007 ↑ 1.0 3 1

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

  • Output: md_care_providing_form.id, md_care_providing_form.code, md_care_providing_form.name, md_care_providing_form.e_code, md_care_providing_form.aud_who, md_care_providing_form.aud_when, md_care_providing_form.aud_source, md_care_providing_form.aud_who_create, md_care_providing_form.aud_when_create, md_care_providing_form.aud_source_create, md_care_providing_form.from_dt, md_care_providing_form.to_dt, md_care_providing_form.billing_code
  • Buffers: shared hit=1
130. 0.005 1.002 ↑ 1.0 1 3

Materialize (cost=4.58..294.81 rows=1 width=111) (actual time=0.205..0.334 rows=1 loops=3)

  • Output: t_6.fields_model
  • Buffers: shared hit=193
131. 0.037 0.997 ↑ 1.0 1 1

Nested Loop (cost=4.58..294.81 rows=1 width=111) (actual time=0.611..0.997 rows=1 loops=1)

  • Output: t_6.fields_model
  • Buffers: shared hit=193
132. 0.050 0.917 ↑ 1.0 1 1

Nested Loop (cost=4.30..294.36 rows=1 width=4) (actual time=0.532..0.917 rows=1 loops=1)

  • Output: tak_6.template_id
  • Buffers: shared hit=190
133. 0.842 0.842 ↑ 1.0 1 1

Seq Scan on sec.access_key ak_6 (cost=0.00..283.33 rows=1 width=4) (actual time=0.457..0.842 rows=1 loops=1)

  • Output: ak_6.id, ak_6.type_id, ak_6.org_id, ak_6.empl_pos_id, ak_6.user_id, ak_6.name, ak_6.is_blocked, ak_6.aud_who, ak_6.aud_when, ak_6.aud_source, ak_6.aud_who_create, ak_6.aud_when_create, ak_6.aud_source_create
  • Filter: ((ak_6.empl_pos_id = 78020) AND (ak_6.org_id = 1805760))
  • Rows Removed by Filter: 6394
  • Buffers: shared hit=187
134. 0.020 0.025 ↑ 2.0 1 1

Bitmap Heap Scan on def.template_access_key tak_6 (cost=4.30..11.01 rows=2 width=8) (actual time=0.025..0.025 rows=1 loops=1)

  • Output: tak_6.id, tak_6.template_id, tak_6.access_key_id, tak_6.is_primary, tak_6.is_author, tak_6.aud_who, tak_6.aud_when, tak_6.aud_source, tak_6.aud_who_create, tak_6.aud_when_create, tak_6.aud_source_create
  • Recheck Cond: (tak_6.access_key_id = ak_6.id)
  • Heap Blocks: exact=1
  • Buffers: shared hit=3
135. 0.005 0.005 ↑ 2.0 1 1

Bitmap Index Scan on idx_template_access_key_access_key_di (cost=0.00..4.29 rows=2 width=0) (actual time=0.005..0.005 rows=1 loops=1)

  • Index Cond: (tak_6.access_key_id = ak_6.id)
  • Buffers: shared hit=2
136. 0.043 0.043 ↑ 1.0 1 1

Index Scan using pk_template on def.template t_6 (cost=0.28..0.43 rows=1 width=115) (actual time=0.042..0.043 rows=1 loops=1)

  • Output: t_6.id, t_6.name, t_6.page_id, t_6.container_id, t_6.widget_id, t_6.fields_model, t_6.filters_model, t_6.aud_who, t_6.aud_when, t_6.aud_source, t_6.aud_who_create, t_6.aud_when_create, t_6.aud_source_create
  • Index Cond: (t_6.id = tak_6.template_id)
  • Filter: ((t_6.page_id = 'resultAdmissionMain'::text) AND (t_6.container_id = 'admissionCase'::text))
  • Buffers: shared hit=3
137. 0.097 1.112 ↓ 0.0 0 1

Nested Loop Semi Join (cost=4.58..296.07 rows=3 width=30) (actual time=1.112..1.112 rows=0 loops=1)

  • Output: row_to_json(ROW(md_care_provision_condition.id, md_care_provision_condition.name))
  • Join Filter: (md_care_provision_condition.id = (((((t_7.fields_model)::json -> 'mcCase'::text) -> 'careProvisionCondition'::text) ->> 'id'::text))::integer)
  • Rows Removed by Join Filter: 6
  • Buffers: shared hit=194
138. 0.007 0.007 ↑ 1.0 6 1

Seq Scan on public.md_care_provision_condition (cost=0.00..1.06 rows=6 width=30) (actual time=0.007..0.007 rows=6 loops=1)

  • Output: md_care_provision_condition.id, md_care_provision_condition.code, md_care_provision_condition.name, md_care_provision_condition.begin_date, md_care_provision_condition.end_date, md_care_provision_condition.e_code, md_care_provision_condition.aud_who, md_care_provision_condition.aud_when, md_care_provision_condition.aud_source, md_care_provision_condition.aud_who_create, md_care_provision_condition.aud_when_create, md_care_provision_condition.aud_source_create, md_care_provision_condition.from_dt, md_care_provision_condition.to_dt
  • Buffers: shared hit=1
139. 0.004 1.008 ↑ 1.0 1 6

Materialize (cost=4.58..294.81 rows=1 width=111) (actual time=0.100..0.168 rows=1 loops=6)

  • Output: t_7.fields_model
  • Buffers: shared hit=193
140. 0.064 1.004 ↑ 1.0 1 1

Nested Loop (cost=4.58..294.81 rows=1 width=111) (actual time=0.598..1.004 rows=1 loops=1)

  • Output: t_7.fields_model
  • Buffers: shared hit=193
141. 0.034 0.910 ↑ 1.0 1 1

Nested Loop (cost=4.30..294.36 rows=1 width=4) (actual time=0.505..0.910 rows=1 loops=1)

  • Output: tak_7.template_id
  • Buffers: shared hit=190
142. 0.847 0.847 ↑ 1.0 1 1

Seq Scan on sec.access_key ak_7 (cost=0.00..283.33 rows=1 width=4) (actual time=0.443..0.847 rows=1 loops=1)

  • Output: ak_7.id, ak_7.type_id, ak_7.org_id, ak_7.empl_pos_id, ak_7.user_id, ak_7.name, ak_7.is_blocked, ak_7.aud_who, ak_7.aud_when, ak_7.aud_source, ak_7.aud_who_create, ak_7.aud_when_create, ak_7.aud_source_create
  • Filter: ((ak_7.empl_pos_id = 78020) AND (ak_7.org_id = 1805760))
  • Rows Removed by Filter: 6394
  • Buffers: shared hit=187
143. 0.024 0.029 ↑ 2.0 1 1

Bitmap Heap Scan on def.template_access_key tak_7 (cost=4.30..11.01 rows=2 width=8) (actual time=0.028..0.029 rows=1 loops=1)

  • Output: tak_7.id, tak_7.template_id, tak_7.access_key_id, tak_7.is_primary, tak_7.is_author, tak_7.aud_who, tak_7.aud_when, tak_7.aud_source, tak_7.aud_who_create, tak_7.aud_when_create, tak_7.aud_source_create
  • Recheck Cond: (tak_7.access_key_id = ak_7.id)
  • Heap Blocks: exact=1
  • Buffers: shared hit=3
144. 0.005 0.005 ↑ 2.0 1 1

Bitmap Index Scan on idx_template_access_key_access_key_di (cost=0.00..4.29 rows=2 width=0) (actual time=0.005..0.005 rows=1 loops=1)

  • Index Cond: (tak_7.access_key_id = ak_7.id)
  • Buffers: shared hit=2
145. 0.030 0.030 ↑ 1.0 1 1

Index Scan using pk_template on def.template t_7 (cost=0.28..0.43 rows=1 width=115) (actual time=0.029..0.030 rows=1 loops=1)

  • Output: t_7.id, t_7.name, t_7.page_id, t_7.container_id, t_7.widget_id, t_7.fields_model, t_7.filters_model, t_7.aud_who, t_7.aud_when, t_7.aud_source, t_7.aud_who_create, t_7.aud_when_create, t_7.aud_source_create
  • Index Cond: (t_7.id = tak_7.template_id)
  • Filter: ((t_7.page_id = 'resultAdmissionMain'::text) AND (t_7.container_id = 'admissionCase'::text))
  • Buffers: shared hit=3
146. 0.073 1.153 ↓ 0.0 0 1

Nested Loop (cost=294.97..295.10 rows=26 width=136) (actual time=1.153..1.153 rows=0 loops=1)

  • Output: row_to_json(ROW(mc_payment_method.id, mc_payment_method.name))
  • Buffers: shared hit=193
147. 0.078 1.067 ↑ 1.0 1 1

HashAggregate (cost=294.81..294.82 rows=1 width=111) (actual time=1.066..1.067 rows=1 loops=1)

  • Output: t_8.fields_model
  • Group Key: (((((t_8.fields_model)::json -> 'mcCase'::text) -> 'paymentMethod'::text) ->> 'id'::text))::integer
  • Buffers: shared hit=193
148. 0.064 0.989 ↑ 1.0 1 1

Nested Loop (cost=4.58..294.81 rows=1 width=111) (actual time=0.594..0.989 rows=1 loops=1)

  • Output: t_8.fields_model, (((((t_8.fields_model)::json -> 'mcCase'::text) -> 'paymentMethod'::text) ->> 'id'::text))::integer
  • Buffers: shared hit=193
149. 0.027 0.897 ↑ 1.0 1 1

Nested Loop (cost=4.30..294.36 rows=1 width=4) (actual time=0.504..0.897 rows=1 loops=1)

  • Output: tak_8.template_id
  • Buffers: shared hit=190
150. 0.841 0.841 ↑ 1.0 1 1

Seq Scan on sec.access_key ak_8 (cost=0.00..283.33 rows=1 width=4) (actual time=0.449..0.841 rows=1 loops=1)

  • Output: ak_8.id, ak_8.type_id, ak_8.org_id, ak_8.empl_pos_id, ak_8.user_id, ak_8.name, ak_8.is_blocked, ak_8.aud_who, ak_8.aud_when, ak_8.aud_source, ak_8.aud_who_create, ak_8.aud_when_create, ak_8.aud_source_create
  • Filter: ((ak_8.empl_pos_id = 78020) AND (ak_8.org_id = 1805760))
  • Rows Removed by Filter: 6394
  • Buffers: shared hit=187
151. 0.024 0.029 ↑ 2.0 1 1

Bitmap Heap Scan on def.template_access_key tak_8 (cost=4.30..11.01 rows=2 width=8) (actual time=0.029..0.029 rows=1 loops=1)

  • Output: tak_8.id, tak_8.template_id, tak_8.access_key_id, tak_8.is_primary, tak_8.is_author, tak_8.aud_who, tak_8.aud_when, tak_8.aud_source, tak_8.aud_who_create, tak_8.aud_when_create, tak_8.aud_source_create
  • Recheck Cond: (tak_8.access_key_id = ak_8.id)
  • Heap Blocks: exact=1
  • Buffers: shared hit=3
152. 0.005 0.005 ↑ 2.0 1 1

Bitmap Index Scan on idx_template_access_key_access_key_di (cost=0.00..4.29 rows=2 width=0) (actual time=0.005..0.005 rows=1 loops=1)

  • Index Cond: (tak_8.access_key_id = ak_8.id)
  • Buffers: shared hit=2
153. 0.028 0.028 ↑ 1.0 1 1

Index Scan using pk_template on def.template t_8 (cost=0.28..0.43 rows=1 width=115) (actual time=0.028..0.028 rows=1 loops=1)

  • Output: t_8.id, t_8.name, t_8.page_id, t_8.container_id, t_8.widget_id, t_8.fields_model, t_8.filters_model, t_8.aud_who, t_8.aud_when, t_8.aud_source, t_8.aud_who_create, t_8.aud_when_create, t_8.aud_source_create
  • Index Cond: (t_8.id = tak_8.template_id)
  • Filter: ((t_8.page_id = 'resultAdmissionMain'::text) AND (t_8.container_id = 'admissionCase'::text))
  • Buffers: shared hit=3
154. 0.013 0.013 ↓ 0.0 0 1

Index Scan using mc_payment_method_pk on public.mc_payment_method (cost=0.16..0.21 rows=1 width=136) (actual time=0.013..0.013 rows=0 loops=1)

  • Output: mc_payment_method.id, mc_payment_method.code, mc_payment_method.name, mc_payment_method.e_code, mc_payment_method.aud_who, mc_payment_method.aud_when, mc_payment_method.aud_source, mc_payment_method.aud_who_create, mc_payment_method.aud_when_create, mc_payment_method.aud_source_create, mc_payment_method.from_dt, mc_payment_method.to_dt, mc_payment_method.billing_code
  • Index Cond: (mc_payment_method.id = (((((t_8.fields_model)::json -> 'mcCase'::text) -> 'paymentMethod'::text) ->> 'id'::text))::integer)
155. 0.083 1.077 ↓ 0.0 0 1

Nested Loop Semi Join (cost=4.58..296.01 rows=2 width=20) (actual time=1.077..1.077 rows=0 loops=1)

  • Output: row_to_json(ROW(plc_visit_place.id, plc_visit_place.name))
  • Join Filter: (plc_visit_place.id = ((((t_9.fields_model)::json -> 'visitPlace'::text) ->> 'id'::text))::integer)
  • Rows Removed by Join Filter: 5
  • Buffers: shared hit=194
156. 0.009 0.009 ↑ 1.0 5 1

Seq Scan on public.plc_visit_place (cost=0.00..1.05 rows=5 width=20) (actual time=0.007..0.009 rows=5 loops=1)

  • Output: plc_visit_place.id, plc_visit_place.code, plc_visit_place.name, plc_visit_place.e_code, plc_visit_place.aud_who, plc_visit_place.aud_when, plc_visit_place.aud_source, plc_visit_place.aud_who_create, plc_visit_place.aud_when_create, plc_visit_place.aud_source_create, plc_visit_place.from_dt, plc_visit_place.to_dt, plc_visit_place.billing_code
  • Buffers: shared hit=1
157. 0.007 0.985 ↑ 1.0 1 5

Materialize (cost=4.58..294.81 rows=1 width=111) (actual time=0.118..0.197 rows=1 loops=5)

  • Output: t_9.fields_model
  • Buffers: shared hit=193
158. 0.046 0.978 ↑ 1.0 1 1

Nested Loop (cost=4.58..294.81 rows=1 width=111) (actual time=0.581..0.978 rows=1 loops=1)

  • Output: t_9.fields_model
  • Buffers: shared hit=193
159. 0.036 0.904 ↑ 1.0 1 1

Nested Loop (cost=4.30..294.36 rows=1 width=4) (actual time=0.509..0.904 rows=1 loops=1)

  • Output: tak_9.template_id
  • Buffers: shared hit=190
160. 0.844 0.844 ↑ 1.0 1 1

Seq Scan on sec.access_key ak_9 (cost=0.00..283.33 rows=1 width=4) (actual time=0.449..0.844 rows=1 loops=1)

  • Output: ak_9.id, ak_9.type_id, ak_9.org_id, ak_9.empl_pos_id, ak_9.user_id, ak_9.name, ak_9.is_blocked, ak_9.aud_who, ak_9.aud_when, ak_9.aud_source, ak_9.aud_who_create, ak_9.aud_when_create, ak_9.aud_source_create
  • Filter: ((ak_9.empl_pos_id = 78020) AND (ak_9.org_id = 1805760))
  • Rows Removed by Filter: 6394
  • Buffers: shared hit=187
161. 0.019 0.024 ↑ 2.0 1 1

Bitmap Heap Scan on def.template_access_key tak_9 (cost=4.30..11.01 rows=2 width=8) (actual time=0.024..0.024 rows=1 loops=1)

  • Output: tak_9.id, tak_9.template_id, tak_9.access_key_id, tak_9.is_primary, tak_9.is_author, tak_9.aud_who, tak_9.aud_when, tak_9.aud_source, tak_9.aud_who_create, tak_9.aud_when_create, tak_9.aud_source_create
  • Recheck Cond: (tak_9.access_key_id = ak_9.id)
  • Heap Blocks: exact=1
  • Buffers: shared hit=3
162. 0.005 0.005 ↑ 2.0 1 1

Bitmap Index Scan on idx_template_access_key_access_key_di (cost=0.00..4.29 rows=2 width=0) (actual time=0.005..0.005 rows=1 loops=1)

  • Index Cond: (tak_9.access_key_id = ak_9.id)
  • Buffers: shared hit=2
163. 0.028 0.028 ↑ 1.0 1 1

Index Scan using pk_template on def.template t_9 (cost=0.28..0.43 rows=1 width=115) (actual time=0.028..0.028 rows=1 loops=1)

  • Output: t_9.id, t_9.name, t_9.page_id, t_9.container_id, t_9.widget_id, t_9.fields_model, t_9.filters_model, t_9.aud_who, t_9.aud_when, t_9.aud_source, t_9.aud_who_create, t_9.aud_when_create, t_9.aud_source_create
  • Index Cond: (t_9.id = tak_9.template_id)
  • Filter: ((t_9.page_id = 'resultAdmissionMain'::text) AND (t_9.container_id = 'admissionCase'::text))
  • Buffers: shared hit=3
164. 0.032 0.032 ↑ 1.0 1 1

Seq Scan on public.plc_visit_place plc_visit_place_1 (cost=0.00..1.06 rows=1 width=20) (actual time=0.031..0.032 rows=1 loops=1)

  • Output: row_to_json(ROW(plc_visit_place_1.id, plc_visit_place_1.name))
  • Filter: ((plc_visit_place_1.code)::text = '1'::text)
  • Rows Removed by Filter: 4
  • Buffers: shared hit=1
165. 0.086 1.169 ↑ 88.0 1 1

Nested Loop (cost=294.97..295.30 rows=88 width=68) (actual time=1.168..1.169 rows=1 loops=1)

  • Output: row_to_json(ROW(md_profile.id, md_profile.name))
  • Buffers: shared hit=195
166. 0.066 1.071 ↑ 1.0 1 1

HashAggregate (cost=294.81..294.82 rows=1 width=111) (actual time=1.070..1.071 rows=1 loops=1)

  • Output: t_10.fields_model
  • Group Key: ((((t_10.fields_model)::json -> 'profile'::text) ->> 'id'::text))::integer
  • Buffers: shared hit=193
167. 0.077 1.005 ↑ 1.0 1 1

Nested Loop (cost=4.58..294.81 rows=1 width=111) (actual time=0.619..1.005 rows=1 loops=1)

  • Output: t_10.fields_model, ((((t_10.fields_model)::json -> 'profile'::text) ->> 'id'::text))::integer
  • Buffers: shared hit=193
168. 0.033 0.892 ↑ 1.0 1 1

Nested Loop (cost=4.30..294.36 rows=1 width=4) (actual time=0.508..0.892 rows=1 loops=1)

  • Output: tak_10.template_id
  • Buffers: shared hit=190
169. 0.833 0.833 ↑ 1.0 1 1

Seq Scan on sec.access_key ak_10 (cost=0.00..283.33 rows=1 width=4) (actual time=0.451..0.833 rows=1 loops=1)

  • Output: ak_10.id, ak_10.type_id, ak_10.org_id, ak_10.empl_pos_id, ak_10.user_id, ak_10.name, ak_10.is_blocked, ak_10.aud_who, ak_10.aud_when, ak_10.aud_source, ak_10.aud_who_create, ak_10.aud_when_create, ak_10.aud_source_create
  • Filter: ((ak_10.empl_pos_id = 78020) AND (ak_10.org_id = 1805760))
  • Rows Removed by Filter: 6394
  • Buffers: shared hit=187
170. 0.021 0.026 ↑ 2.0 1 1

Bitmap Heap Scan on def.template_access_key tak_10 (cost=4.30..11.01 rows=2 width=8) (actual time=0.026..0.026 rows=1 loops=1)

  • Output: tak_10.id, tak_10.template_id, tak_10.access_key_id, tak_10.is_primary, tak_10.is_author, tak_10.aud_who, tak_10.aud_when, tak_10.aud_source, tak_10.aud_who_create, tak_10.aud_when_create, tak_10.aud_source_create
  • Recheck Cond: (tak_10.access_key_id = ak_10.id)
  • Heap Blocks: exact=1
  • Buffers: shared hit=3
171. 0.005 0.005 ↑ 2.0 1 1

Bitmap Index Scan on idx_template_access_key_access_key_di (cost=0.00..4.29 rows=2 width=0) (actual time=0.005..0.005 rows=1 loops=1)

  • Index Cond: (tak_10.access_key_id = ak_10.id)
  • Buffers: shared hit=2
172. 0.036 0.036 ↑ 1.0 1 1

Index Scan using pk_template on def.template t_10 (cost=0.28..0.43 rows=1 width=115) (actual time=0.035..0.036 rows=1 loops=1)

  • Output: t_10.id, t_10.name, t_10.page_id, t_10.container_id, t_10.widget_id, t_10.fields_model, t_10.filters_model, t_10.aud_who, t_10.aud_when, t_10.aud_source, t_10.aud_who_create, t_10.aud_when_create, t_10.aud_source_create
  • Index Cond: (t_10.id = tak_10.template_id)
  • Filter: ((t_10.page_id = 'resultAdmissionMain'::text) AND (t_10.container_id = 'admissionCase'::text))
  • Buffers: shared hit=3
173. 0.012 0.012 ↑ 1.0 1 1

Index Scan using md_profile_pk on public.md_profile (cost=0.16..0.25 rows=1 width=68) (actual time=0.012..0.012 rows=1 loops=1)

  • Output: md_profile.id, md_profile.code, md_profile.genitive_name, md_profile.name, md_profile.e_code, md_profile.aud_who, md_profile.aud_when, md_profile.aud_source, md_profile.aud_who_create, md_profile.aud_when_create, md_profile.aud_source_create, md_profile.from_dt, md_profile.to_dt, md_profile.billing_code
  • Index Cond: (md_profile.id = ((((t_10.fields_model)::json -> 'profile'::text) ->> 'id'::text))::integer)
  • Buffers: shared hit=2
174. 0.101 1.144 ↓ 0.0 0 1

Nested Loop (cost=295.11..316.50 rows=7,464 width=121) (actual time=1.144..1.144 rows=0 loops=1)

  • Output: row_to_json(ROW(md_diagnosis.id, md_diagnosis.name))
  • Buffers: shared hit=193
175. 0.056 1.034 ↑ 1.0 1 1

HashAggregate (cost=294.81..294.82 rows=1 width=111) (actual time=1.034..1.034 rows=1 loops=1)

  • Output: t_11.fields_model
  • Group Key: ((((t_11.fields_model)::json -> 'diagnosis'::text) ->> 'id'::text))::integer
  • Buffers: shared hit=193
176. 0.055 0.978 ↑ 1.0 1 1

Nested Loop (cost=4.58..294.81 rows=1 width=111) (actual time=0.596..0.978 rows=1 loops=1)

  • Output: t_11.fields_model, ((((t_11.fields_model)::json -> 'diagnosis'::text) ->> 'id'::text))::integer
  • Buffers: shared hit=193
177. 0.031 0.892 ↑ 1.0 1 1

Nested Loop (cost=4.30..294.36 rows=1 width=4) (actual time=0.512..0.892 rows=1 loops=1)

  • Output: tak_11.template_id
  • Buffers: shared hit=190
178. 0.838 0.838 ↑ 1.0 1 1

Seq Scan on sec.access_key ak_11 (cost=0.00..283.33 rows=1 width=4) (actual time=0.458..0.838 rows=1 loops=1)

  • Output: ak_11.id, ak_11.type_id, ak_11.org_id, ak_11.empl_pos_id, ak_11.user_id, ak_11.name, ak_11.is_blocked, ak_11.aud_who, ak_11.aud_when, ak_11.aud_source, ak_11.aud_who_create, ak_11.aud_when_create, ak_11.aud_source_create
  • Filter: ((ak_11.empl_pos_id = 78020) AND (ak_11.org_id = 1805760))
  • Rows Removed by Filter: 6394
  • Buffers: shared hit=187
179. 0.018 0.023 ↑ 2.0 1 1

Bitmap Heap Scan on def.template_access_key tak_11 (cost=4.30..11.01 rows=2 width=8) (actual time=0.023..0.023 rows=1 loops=1)

  • Output: tak_11.id, tak_11.template_id, tak_11.access_key_id, tak_11.is_primary, tak_11.is_author, tak_11.aud_who, tak_11.aud_when, tak_11.aud_source, tak_11.aud_who_create, tak_11.aud_when_create, tak_11.aud_source_create
  • Recheck Cond: (tak_11.access_key_id = ak_11.id)
  • Heap Blocks: exact=1
  • Buffers: shared hit=3
180. 0.005 0.005 ↑ 2.0 1 1

Bitmap Index Scan on idx_template_access_key_access_key_di (cost=0.00..4.29 rows=2 width=0) (actual time=0.005..0.005 rows=1 loops=1)

  • Index Cond: (tak_11.access_key_id = ak_11.id)
  • Buffers: shared hit=2
181. 0.031 0.031 ↑ 1.0 1 1

Index Scan using pk_template on def.template t_11 (cost=0.28..0.43 rows=1 width=115) (actual time=0.030..0.031 rows=1 loops=1)

  • Output: t_11.id, t_11.name, t_11.page_id, t_11.container_id, t_11.widget_id, t_11.fields_model, t_11.filters_model, t_11.aud_who, t_11.aud_when, t_11.aud_source, t_11.aud_who_create, t_11.aud_when_create, t_11.aud_source_create
  • Index Cond: (t_11.id = tak_11.template_id)
  • Filter: ((t_11.page_id = 'resultAdmissionMain'::text) AND (t_11.container_id = 'admissionCase'::text))
  • Buffers: shared hit=3
182. 0.009 0.009 ↓ 0.0 0 1

Index Scan using md_diagnosis_pk on public.md_diagnosis (cost=0.30..3.01 rows=1 width=121) (actual time=0.009..0.009 rows=0 loops=1)

  • Output: md_diagnosis.id, md_diagnosis.code, md_diagnosis.name, md_diagnosis.parent_id, md_diagnosis.is_injury, md_diagnosis.level, md_diagnosis.is_leaf, md_diagnosis.e_code, md_diagnosis.oms, md_diagnosis.stomat, md_diagnosis.aud_who, md_diagnosis.aud_when, md_diagnosis.aud_source, md_diagnosis.aud_who_create, md_diagnosis.aud_when_create, md_diagnosis.aud_source_create, md_diagnosis.from_dt, md_diagnosis.to_dt
  • Index Cond: (md_diagnosis.id = ((((t_11.fields_model)::json -> 'diagnosis'::text) ->> 'id'::text))::integer)
183. 0.081 1.098 ↓ 0.0 0 1

Nested Loop Semi Join (cost=4.58..296.14 rows=4 width=43) (actual time=1.098..1.098 rows=0 loops=1)

  • Output: row_to_json(ROW(mc_disease_type.id, mc_disease_type.name))
  • Join Filter: (mc_disease_type.id = ((((t_13.fields_model)::json -> 'diseaseType'::text) ->> 'id'::text))::integer)
  • Rows Removed by Join Filter: 8
  • Buffers: shared hit=194
184. 0.017 0.017 ↑ 1.0 8 1

Seq Scan on public.mc_disease_type (cost=0.00..1.08 rows=8 width=43) (actual time=0.015..0.017 rows=8 loops=1)

  • Output: mc_disease_type.id, mc_disease_type.code, mc_disease_type.name, mc_disease_type.e_code, mc_disease_type.aud_who, mc_disease_type.aud_when, mc_disease_type.aud_source, mc_disease_type.aud_who_create, mc_disease_type.aud_when_create, mc_disease_type.aud_source_create, mc_disease_type.from_dt, mc_disease_type.to_dt, mc_disease_type.billing_code
  • Buffers: shared hit=1
185. 0.019 1.000 ↑ 1.0 1 8

Materialize (cost=4.58..294.81 rows=1 width=111) (actual time=0.077..0.125 rows=1 loops=8)

  • Output: t_13.fields_model
  • Buffers: shared hit=193
186. 0.033 0.981 ↑ 1.0 1 1

Nested Loop (cost=4.58..294.81 rows=1 width=111) (actual time=0.599..0.981 rows=1 loops=1)

  • Output: t_13.fields_model
  • Buffers: shared hit=193
187. 0.037 0.919 ↑ 1.0 1 1

Nested Loop (cost=4.30..294.36 rows=1 width=4) (actual time=0.538..0.919 rows=1 loops=1)

  • Output: tak_13.template_id
  • Buffers: shared hit=190
188. 0.846 0.846 ↑ 1.0 1 1

Seq Scan on sec.access_key ak_13 (cost=0.00..283.33 rows=1 width=4) (actual time=0.465..0.846 rows=1 loops=1)

  • Output: ak_13.id, ak_13.type_id, ak_13.org_id, ak_13.empl_pos_id, ak_13.user_id, ak_13.name, ak_13.is_blocked, ak_13.aud_who, ak_13.aud_when, ak_13.aud_source, ak_13.aud_who_create, ak_13.aud_when_create, ak_13.aud_source_create
  • Filter: ((ak_13.empl_pos_id = 78020) AND (ak_13.org_id = 1805760))
  • Rows Removed by Filter: 6394
  • Buffers: shared hit=187
189. 0.031 0.036 ↑ 2.0 1 1

Bitmap Heap Scan on def.template_access_key tak_13 (cost=4.30..11.01 rows=2 width=8) (actual time=0.036..0.036 rows=1 loops=1)

  • Output: tak_13.id, tak_13.template_id, tak_13.access_key_id, tak_13.is_primary, tak_13.is_author, tak_13.aud_who, tak_13.aud_when, tak_13.aud_source, tak_13.aud_who_create, tak_13.aud_when_create, tak_13.aud_source_create
  • Recheck Cond: (tak_13.access_key_id = ak_13.id)
  • Heap Blocks: exact=1
  • Buffers: shared hit=3
190. 0.005 0.005 ↑ 2.0 1 1

Bitmap Index Scan on idx_template_access_key_access_key_di (cost=0.00..4.29 rows=2 width=0) (actual time=0.005..0.005 rows=1 loops=1)

  • Index Cond: (tak_13.access_key_id = ak_13.id)
  • Buffers: shared hit=2
191. 0.029 0.029 ↑ 1.0 1 1

Index Scan using pk_template on def.template t_13 (cost=0.28..0.43 rows=1 width=115) (actual time=0.028..0.029 rows=1 loops=1)

  • Output: t_13.id, t_13.name, t_13.page_id, t_13.container_id, t_13.widget_id, t_13.fields_model, t_13.filters_model, t_13.aud_who, t_13.aud_when, t_13.aud_source, t_13.aud_who_create, t_13.aud_when_create, t_13.aud_source_create
  • Index Cond: (t_13.id = tak_13.template_id)
  • Filter: ((t_13.page_id = 'resultAdmissionMain'::text) AND (t_13.container_id = 'admissionCase'::text))
  • Buffers: shared hit=3
192. 16.980 467.567 ↑ 1.0 1 1

Nested Loop Left Join (cost=11.35..16,954.91 rows=1 width=1,520) (actual time=466.200..467.567 rows=1 loops=1)

  • Output: ssr.id, (SubPlan 1), mc.id, mc.id, mc.uid, CASE WHEN ((mc.main_diagnos_id IS NULL) AND (mc.open_date IS NOT NULL)) THEN (('№'::text || (COALESCE(mc.uid, ''::character varying))::text) || CASE WHEN (mc.closing_step_id IS NULL) THEN (' Открыт:'::text || COALESCE(to_char((mc.open_date)::timestamp with time zone, 'dd.mm.yyyy'::text), ''::text)) ELSE (' Закрыт:'::text || COALESCE(to_char((mc.close_date)::timestamp with time zone, 'dd.mm.yyyy'::text), ''::text)) END) ELSE (((('№'::text || (COALESCE(mc.uid, ''::character varying))::text) || CASE WHEN (mc.closing_step_id IS NULL) THEN (' Открыт:'::text || COALESCE(to_char((mc.open_date)::timestamp with time zone, 'dd.mm.yyyy'::text), ''::text)) ELSE (' Закрыт:'::text || COALESCE(to_char((mc.close_date)::timestamp with time zone, 'dd.mm.yyyy'::text), ''::text)) END) || ' '::text) || (SubPlan 2)) END, mc.open_date, (SubPlan 3), (SubPlan 4), mc.is_finance_type_control, mc.is_finance_type_control, (SubPlan 5), (SubPlan 6), $13, (SubPlan 8), (SubPlan 9), (SubPlan 10), (SubPlan 11), (SubPlan 12), mar.external_reason_input_is_allowed, (SubPlan 13), NULL::unknown, NULL::unknown, COALESCE(mc.is_social_significant, $30), mc.id, mc.patient_id, (SubPlan 15), (SubPlan 16), CASE WHEN (mc.closing_step_id IS NULL) THEN false ELSE true END, (((((((COALESCE(pirg.surname, ''::character varying))::text || ' '::text) || (COALESCE(pirg.name, ''::character varying))::text) || ' '::text) || (COALESCE(pirg.patr_name, ''::character varying))::text) || '
  • '::text) || (COALESCE(perg.note, ''::character varying))::text), srgrg.id, peprg.id, mc.main_diagnos_id, (SubPlan 17), ms.id, CASE WHEN (ms.id IS NULL) THEN CASE WHEN (ma.id IS NULL) THEN now() ELSE (ma.bdatetime)::timestamp with time zone END ELSE ((ms.admission_date + ms.admission_time))::timestamp with time zone END, CASE WHEN (ms.id IS NULL) THEN CASE WHEN (ma.id IS NULL) THEN now() ELSE (ma.bdatetime)::timestamp with time zone END ELSE (ms.admission_date)::timestamp with time zone END, ms.outcome_date, CASE WHEN (ms.id IS NULL) THEN CASE WHEN (ma.id IS NULL) THEN now() ELSE (ma.bdatetime)::timestamp with time zone END ELSE ((ms.admission_date + ms.admission_time))::timestamp with time zone END, pv.place_id, ms.res_group_id, CASE WHEN (md.stage_id IS NULL) THEN 3 ELSE md.stage_id END, CASE WHEN (ms.id IS NULL) THEN CASE WHEN (ma.id IS NULL) THEN CASE WHEN (($34 > 1) OR ($36 > 1)) THEN NULL::integer ELSE $38 END ELSE CASE WHEN (srgp.profile_id IS NULL) THEN NULL::integer ELSE srgp.profile_id END END ELSE ms.profile_id END, CASE WHEN (ms.id IS NULL) THEN CASE WHEN (ma.id IS NULL) THEN CASE WHEN (($39 > 1) OR ($41 > 1)) THEN NULL::text ELSE $44 END ELSE CASE WHEN (srgp.profile_id IS NULL) THEN NULL::text ELSE (SubPlan 27) END END ELSE (SubPlan 28) END, md1.id, (((md1.code)::text || ' '::text) || (md1.name)::text), md1.code, md1.is_injury, md2.id, (((md2.code)::text || ' '::text) || (md2.name)::text), mar.id, (((mar.code)::text || ' '::text) || (mar.name)::text), md.id, md.is_zno_suspicion, CASE WHEN (ms.main_diagnosis_id IS NULL) THEN false ELSE true END, (SubPlan 30), md.disease_type_id, (SubPlan 36), ssrss.id, (SubPlan 40), ssr.id, CASE WHEN (pv.initiator_id = 2) THEN true ELSE false END, ssr.customer_id, (SubPlan 41), $69, (SubPlan 49), r.id, NULL::unknown, $85, ref_org.id, COALESCE(ref_org.short_name, ref_org.full_name), ref_dep.id, ref_dep.name, r.ref_doctor_id, (SubPlan 52), ref_diag.id, (((ref_diag.code)::text || ' '::text) || (ref_diag.name)::text), r.order_number, r.referral_date, r.diagnosis_comment, ma.id, ss.is_house_call, ssr.res_group_id, CASE WHEN (ma.executor_id IS NULL) THEN ('employeeId='::text || ((SubPlan 53))::text) ELSE ('appointment.resourceGroupId='::text || (ma.executor_id)::text) END, ssr.id, ssr.org_id, ssr.customer_id, ssr.res_group_id, (SubPlan 54), ma.service_id, ms.id, CASE WHEN (ma.id IS NULL) THEN ''::text ELSE ('ticket_id='::text || (ma.id)::text) END, (SubPlan 55), (SubPlan 57), CASE WHEN (mc.closing_step_id IS NULL) THEN false ELSE true END, 1805760, NULL::unknown, (SubPlan 59), (SubPlan 61), (SubPlan 63), ssr.customer_id, 1805760, 78020, $107, NULL::unknown, ssr.org_id, CASE WHEN ((SubPlan 65) > 0) THEN true ELSE false END, pv.dental_formula_id, (SubPlan 66), CASE WHEN (ssrss.id IS NULL) THEN CASE WHEN ($111 > 1) THEN false ELSE CASE WHEN ($113 > 1) THEN false ELSE $116 END END ELSE ssrss.is_stomat END, CASE WHEN (pv.dental_formula_id IS NOT NULL) THEN true ELSE false END, (alternatives: SubPlan 72 or hashed SubPlan 73), mc.rankin_scale_for_admission_id, CASE WHEN (ma.id IS NULL) THEN now() ELSE (ma.bdatetime)::timestamp with time zone END, $121, $124, COALESCE($127, $128), $131, $134, $138, $141, $144, $148, COALESCE($151, $152), $156, $160, (SubPlan 94), $174, NULL::unknown, (SubPlan 98), (SubPlan 99), pv.goal_id, CASE WHEN (mc.main_diagnos_id = (SubPlan 100)) THEN true ELSE false END, COALESCE((('№'::text || (mc.uid)::text) || ','::text), ''::text), (SubPlan 101), (SubPlan 108), (SubPlan 115)
  • Buffers: shared hit=211900
193. 0.017 1.798 ↑ 1.0 1 1

Nested Loop Left Join (cost=11.07..72.48 rows=1 width=1,398) (actual time=0.439..1.798 rows=1 loops=1)

  • Output: ssr.id, ssr.customer_id, ssr.service_id, ssr.bdate, ssr.res_group_id, ssr.org_id, ma.id, ma.bdatetime, ma.service_id, ma.executor_id, ss.is_house_call, ms.main_diagnosis_id, ms.id, ms.admission_date, ms.admission_time, ms.outcome_date, ms.res_group_id, ms.profile_id, mc.id, mc.uid, mc.main_diagnos_id, mc.open_date, mc.closing_step_id, mc.close_date, mc.is_finance_type_control, mc.is_social_significant, mc.patient_id, mc.rankin_scale_for_admission_id, mar.id, mar.code, mar.name, mar.external_reason_input_is_allowed, pv.place_id, pv.initiator_id, pv.dental_formula_id, pv.goal_id, mct.id, mct.name, mcr.id, mcr.name, mpm.id, mpm.name, mcpf.id, mcpf.name, ffst.id, ffst.name, mcpc.id, mcpc.name, mcl.id, mcl.name, mcig.id, mcig.code, mcig.name, srgrg.id, peprg.id, perg.note, pirg.surname, pirg.name, pirg.patr_name, srgp.profile_id, md.stage_id, md.id, md.is_zno_suspicion, md.disease_type_id, md1.id, md1.code, md1.name, md1.is_injury, md2.id, md2.code, md2.name, ssrss.id, ssrss.is_stomat, md3.id, md3.code, md3.name, ra.patient_id, r.id, r.ref_doctor_id, r.order_number, r.referral_date, r.diagnosis_comment, r.diagnosis_id, ref_org.id, ref_org.short_name, ref_org.full_name, ref_dep.id, ref_dep.name
  • Buffers: shared hit=90
194. 0.022 1.781 ↑ 1.0 1 1

Nested Loop Left Join (cost=10.79..72.17 rows=1 width=1,340) (actual time=0.437..1.781 rows=1 loops=1)

  • Output: ssr.id, ssr.customer_id, ssr.service_id, ssr.bdate, ssr.res_group_id, ssr.org_id, ma.id, ma.bdatetime, ma.service_id, ma.executor_id, ss.is_house_call, ms.main_diagnosis_id, ms.id, ms.admission_date, ms.admission_time, ms.outcome_date, ms.res_group_id, ms.profile_id, mc.id, mc.uid, mc.main_diagnos_id, mc.open_date, mc.closing_step_id, mc.close_date, mc.is_finance_type_control, mc.is_social_significant, mc.patient_id, mc.rankin_scale_for_admission_id, mar.id, mar.code, mar.name, mar.external_reason_input_is_allowed, pv.place_id, pv.initiator_id, pv.dental_formula_id, pv.goal_id, mct.id, mct.name, mcr.id, mcr.name, mpm.id, mpm.name, mcpf.id, mcpf.name, ffst.id, ffst.name, mcpc.id, mcpc.name, mcl.id, mcl.name, mcig.id, mcig.code, mcig.name, srgrg.id, peprg.id, perg.note, pirg.surname, pirg.name, pirg.patr_name, srgp.profile_id, md.stage_id, md.id, md.is_zno_suspicion, md.disease_type_id, md1.id, md1.code, md1.name, md1.is_injury, md2.id, md2.code, md2.name, ssrss.id, ssrss.is_stomat, md3.id, md3.code, md3.name, ra.patient_id, r.id, r.ref_doctor_id, r.order_number, r.referral_date, r.diagnosis_comment, r.ref_department_id, r.diagnosis_id, ref_org.id, ref_org.short_name, ref_org.full_name
  • Buffers: shared hit=90
195. 0.022 1.758 ↑ 1.0 1 1

Nested Loop Left Join (cost=10.50..71.85 rows=1 width=1,229) (actual time=0.434..1.758 rows=1 loops=1)

  • Output: ssr.id, ssr.customer_id, ssr.service_id, ssr.bdate, ssr.res_group_id, ssr.org_id, ma.id, ma.bdatetime, ma.service_id, ma.executor_id, ss.is_house_call, ms.main_diagnosis_id, ms.id, ms.admission_date, ms.admission_time, ms.outcome_date, ms.res_group_id, ms.profile_id, mc.id, mc.uid, mc.main_diagnos_id, mc.open_date, mc.closing_step_id, mc.close_date, mc.is_finance_type_control, mc.is_social_significant, mc.patient_id, mc.rankin_scale_for_admission_id, mar.id, mar.code, mar.name, mar.external_reason_input_is_allowed, pv.place_id, pv.initiator_id, pv.dental_formula_id, pv.goal_id, mct.id, mct.name, mcr.id, mcr.name, mpm.id, mpm.name, mcpf.id, mcpf.name, ffst.id, ffst.name, mcpc.id, mcpc.name, mcl.id, mcl.name, mcig.id, mcig.code, mcig.name, srgrg.id, peprg.id, perg.note, pirg.surname, pirg.name, pirg.patr_name, srgp.profile_id, md.stage_id, md.id, md.is_zno_suspicion, md.disease_type_id, md1.id, md1.code, md1.name, md1.is_injury, md2.id, md2.code, md2.name, ssrss.id, ssrss.is_stomat, md3.id, md3.code, md3.name, ra.patient_id, r.id, r.ref_doctor_id, r.order_number, r.referral_date, r.diagnosis_comment, r.ref_organization_id, r.ref_department_id, r.diagnosis_id
  • Buffers: shared hit=90
196. 0.016 1.736 ↑ 1.0 1 1

Nested Loop Left Join (cost=10.07..71.39 rows=1 width=1,165) (actual time=0.431..1.736 rows=1 loops=1)

  • Output: ssr.id, ssr.customer_id, ssr.service_id, ssr.bdate, ssr.res_group_id, ssr.org_id, ma.id, ma.bdatetime, ma.service_id, ma.executor_id, ss.is_house_call, ms.main_diagnosis_id, ms.id, ms.admission_date, ms.admission_time, ms.outcome_date, ms.res_group_id, ms.profile_id, mc.id, mc.uid, mc.main_diagnos_id, mc.open_date, mc.closing_step_id, mc.close_date, mc.is_finance_type_control, mc.is_social_significant, mc.patient_id, mc.rankin_scale_for_admission_id, mc.referral_id, mar.id, mar.code, mar.name, mar.external_reason_input_is_allowed, pv.place_id, pv.initiator_id, pv.dental_formula_id, pv.goal_id, mct.id, mct.name, mcr.id, mcr.name, mpm.id, mpm.name, mcpf.id, mcpf.name, ffst.id, ffst.name, mcpc.id, mcpc.name, mcl.id, mcl.name, mcig.id, mcig.code, mcig.name, srgrg.id, peprg.id, perg.note, pirg.surname, pirg.name, pirg.patr_name, srgp.profile_id, md.stage_id, md.id, md.is_zno_suspicion, md.disease_type_id, md1.id, md1.code, md1.name, md1.is_injury, md2.id, md2.code, md2.name, ssrss.id, ssrss.is_stomat, md3.id, md3.code, md3.name, ra.patient_id
  • Buffers: shared hit=90
197. 0.017 1.716 ↑ 1.0 1 1

Nested Loop Left Join (cost=9.93..71.22 rows=1 width=1,161) (actual time=0.425..1.716 rows=1 loops=1)

  • Output: ssr.id, ssr.customer_id, ssr.service_id, ssr.bdate, ssr.res_group_id, ssr.org_id, ma.id, ma.bdatetime, ma.service_id, ma.executor_id, ss.is_house_call, ms.main_diagnosis_id, ms.id, ms.admission_date, ms.admission_time, ms.outcome_date, ms.res_group_id, ms.profile_id, mc.id, mc.uid, mc.main_diagnos_id, mc.open_date, mc.closing_step_id, mc.close_date, mc.is_finance_type_control, mc.is_social_significant, mc.patient_id, mc.rankin_scale_for_admission_id, mc.referral_id, mar.id, mar.code, mar.name, mar.external_reason_input_is_allowed, pv.place_id, pv.initiator_id, pv.dental_formula_id, pv.goal_id, mct.id, mct.name, mcr.id, mcr.name, mpm.id, mpm.name, mcpf.id, mcpf.name, ffst.id, ffst.name, mcpc.id, mcpc.name, mcl.id, mcl.name, mcig.id, mcig.code, mcig.name, srgrg.id, peprg.id, perg.note, pirg.surname, pirg.name, pirg.patr_name, srgp.profile_id, md.stage_id, md.id, md.is_zno_suspicion, md.disease_type_id, md1.id, md1.code, md1.name, md1.is_injury, md2.id, md2.code, md2.name, ssrss.id, ssrss.is_stomat, md3.id, md3.code, md3.name
  • Buffers: shared hit=89
198. 0.027 1.699 ↑ 1.0 1 1

Nested Loop Left Join (cost=9.64..70.90 rows=1 width=1,039) (actual time=0.422..1.699 rows=1 loops=1)

  • Output: ssr.id, ssr.customer_id, ssr.service_id, ssr.bdate, ssr.res_group_id, ssr.org_id, ma.id, ma.bdatetime, ma.service_id, ma.executor_id, ss.is_house_call, ms.main_diagnosis_id, ms.id, ms.admission_date, ms.admission_time, ms.outcome_date, ms.res_group_id, ms.profile_id, mc.id, mc.uid, mc.main_diagnos_id, mc.open_date, mc.closing_step_id, mc.close_date, mc.is_finance_type_control, mc.is_social_significant, mc.patient_id, mc.rankin_scale_for_admission_id, mc.external_reason_mkb_id, mc.referral_id, mar.id, mar.code, mar.name, mar.external_reason_input_is_allowed, pv.place_id, pv.initiator_id, pv.dental_formula_id, pv.goal_id, mct.id, mct.name, mcr.id, mcr.name, mpm.id, mpm.name, mcpf.id, mcpf.name, ffst.id, ffst.name, mcpc.id, mcpc.name, mcl.id, mcl.name, mcig.id, mcig.code, mcig.name, srgrg.id, peprg.id, perg.note, pirg.surname, pirg.name, pirg.patr_name, srgp.profile_id, md.stage_id, md.id, md.is_zno_suspicion, md.disease_type_id, md1.id, md1.code, md1.name, md1.is_injury, md2.id, md2.code, md2.name, ssrss.id, ssrss.is_stomat
  • Buffers: shared hit=89
199. 0.018 1.637 ↑ 1.0 1 1

Nested Loop Left Join (cost=9.22..62.45 rows=1 width=1,034) (actual time=0.406..1.637 rows=1 loops=1)

  • Output: ssr.id, ssr.customer_id, ssr.service_id, ssr.bdate, ssr.res_group_id, ssr.org_id, ma.id, ma.bdatetime, ma.service_id, ma.executor_id, ss.is_house_call, ms.main_diagnosis_id, ms.id, ms.admission_date, ms.admission_time, ms.outcome_date, ms.res_group_id, ms.profile_id, mc.id, mc.uid, mc.main_diagnos_id, mc.open_date, mc.closing_step_id, mc.close_date, mc.is_finance_type_control, mc.is_social_significant, mc.patient_id, mc.rankin_scale_for_admission_id, mc.external_reason_mkb_id, mc.referral_id, mar.id, mar.code, mar.name, mar.external_reason_input_is_allowed, pv.place_id, pv.initiator_id, pv.dental_formula_id, pv.goal_id, mct.id, mct.name, mcr.id, mcr.name, mpm.id, mpm.name, mcpf.id, mcpf.name, ffst.id, ffst.name, mcpc.id, mcpc.name, mcl.id, mcl.name, mcig.id, mcig.code, mcig.name, srgrg.id, peprg.id, perg.note, pirg.surname, pirg.name, pirg.patr_name, srgp.profile_id, md.stage_id, md.id, md.is_zno_suspicion, md.disease_type_id, md1.id, md1.code, md1.name, md1.is_injury, md2.id, md2.code, md2.name
  • Buffers: shared hit=85
200. 0.029 1.619 ↑ 1.0 1 1

Nested Loop Left Join (cost=8.94..62.14 rows=1 width=912) (actual time=0.404..1.619 rows=1 loops=1)

  • Output: ssr.id, ssr.customer_id, ssr.service_id, ssr.bdate, ssr.res_group_id, ssr.org_id, ma.id, ma.bdatetime, ma.service_id, ma.executor_id, ss.is_house_call, ms.main_diagnosis_id, ms.id, ms.admission_date, ms.admission_time, ms.outcome_date, ms.res_group_id, ms.profile_id, mc.id, mc.uid, mc.main_diagnos_id, mc.open_date, mc.closing_step_id, mc.close_date, mc.is_finance_type_control, mc.is_social_significant, mc.patient_id, mc.rankin_scale_for_admission_id, mc.external_reason_mkb_id, mc.referral_id, mar.id, mar.code, mar.name, mar.external_reason_input_is_allowed, pv.place_id, pv.initiator_id, pv.dental_formula_id, pv.goal_id, mct.id, mct.name, mcr.id, mcr.name, mpm.id, mpm.name, mcpf.id, mcpf.name, ffst.id, ffst.name, mcpc.id, mcpc.name, mcl.id, mcl.name, mcig.id, mcig.code, mcig.name, srgrg.id, peprg.id, perg.note, pirg.surname, pirg.name, pirg.patr_name, srgp.profile_id, md.stage_id, md.id, md.is_zno_suspicion, md.disease_type_id, md.injury_reason_id, md1.id, md1.code, md1.name, md1.is_injury
  • Buffers: shared hit=85
201. 0.038 1.560 ↑ 1.0 1 1

Nested Loop Left Join (cost=8.65..61.83 rows=1 width=789) (actual time=0.392..1.560 rows=1 loops=1)

  • Output: ssr.id, ssr.customer_id, ssr.service_id, ssr.bdate, ssr.res_group_id, ssr.org_id, ma.id, ma.bdatetime, ma.service_id, ma.executor_id, ss.is_house_call, ms.main_diagnosis_id, ms.id, ms.admission_date, ms.admission_time, ms.outcome_date, ms.res_group_id, ms.profile_id, mc.id, mc.uid, mc.main_diagnos_id, mc.open_date, mc.closing_step_id, mc.close_date, mc.is_finance_type_control, mc.is_social_significant, mc.patient_id, mc.rankin_scale_for_admission_id, mc.external_reason_mkb_id, mc.referral_id, mar.id, mar.code, mar.name, mar.external_reason_input_is_allowed, pv.place_id, pv.initiator_id, pv.dental_formula_id, pv.goal_id, mct.id, mct.name, mcr.id, mcr.name, mpm.id, mpm.name, mcpf.id, mcpf.name, ffst.id, ffst.name, mcpc.id, mcpc.name, mcl.id, mcl.name, mcig.id, mcig.code, mcig.name, srgrg.id, peprg.id, perg.note, pirg.surname, pirg.name, pirg.patr_name, srgp.profile_id, md.stage_id, md.id, md.is_zno_suspicion, md.disease_type_id, md.diagnos_id, md.injury_reason_id
  • Buffers: shared hit=82
202. 0.026 1.489 ↑ 1.0 1 1

Nested Loop Left Join (cost=8.09..61.12 rows=1 width=768) (actual time=0.371..1.489 rows=1 loops=1)

  • Output: ssr.id, ssr.customer_id, ssr.service_id, ssr.bdate, ssr.res_group_id, ssr.org_id, ma.id, ma.bdatetime, ma.service_id, ma.executor_id, ss.is_house_call, ms.main_diagnosis_id, ms.id, ms.admission_date, ms.admission_time, ms.outcome_date, ms.res_group_id, ms.profile_id, mc.id, mc.uid, mc.main_diagnos_id, mc.open_date, mc.closing_step_id, mc.close_date, mc.is_finance_type_control, mc.is_social_significant, mc.patient_id, mc.rankin_scale_for_admission_id, mc.external_reason_mkb_id, mc.referral_id, mar.id, mar.code, mar.name, mar.external_reason_input_is_allowed, pv.place_id, pv.initiator_id, pv.dental_formula_id, pv.goal_id, mct.id, mct.name, mcr.id, mcr.name, mpm.id, mpm.name, mcpf.id, mcpf.name, ffst.id, ffst.name, mcpc.id, mcpc.name, mcl.id, mcl.name, mcig.id, mcig.code, mcig.name, srgrg.id, peprg.id, perg.note, pirg.surname, pirg.name, pirg.patr_name, srgp.profile_id
  • Buffers: shared hit=77
203. 0.030 1.429 ↑ 1.0 1 1

Nested Loop Left Join (cost=7.80..60.80 rows=1 width=768) (actual time=0.359..1.429 rows=1 loops=1)

  • Output: ssr.id, ssr.customer_id, ssr.service_id, ssr.bdate, ssr.res_group_id, ssr.org_id, ma.id, ma.bdatetime, ma.service_id, ma.executor_id, ss.is_house_call, ms.main_diagnosis_id, ms.id, ms.admission_date, ms.admission_time, ms.outcome_date, ms.res_group_id, ms.profile_id, mc.id, mc.uid, mc.main_diagnos_id, mc.open_date, mc.closing_step_id, mc.close_date, mc.is_finance_type_control, mc.is_social_significant, mc.patient_id, mc.rankin_scale_for_admission_id, mc.external_reason_mkb_id, mc.referral_id, mar.id, mar.code, mar.name, mar.external_reason_input_is_allowed, pv.place_id, pv.initiator_id, pv.dental_formula_id, pv.goal_id, mct.id, mct.name, mcr.id, mcr.name, mpm.id, mpm.name, mcpf.id, mcpf.name, ffst.id, ffst.name, mcpc.id, mcpc.name, mcl.id, mcl.name, mcig.id, mcig.code, mcig.name, srgrg.id, peprg.id, perg.note, pirg.surname, pirg.name, pirg.patr_name, msrg.id
  • Buffers: shared hit=74
204. 0.030 1.368 ↑ 1.0 1 1

Nested Loop Left Join (cost=7.23..52.21 rows=1 width=764) (actual time=0.339..1.368 rows=1 loops=1)

  • Output: ssr.id, ssr.customer_id, ssr.service_id, ssr.bdate, ssr.res_group_id, ssr.org_id, ma.id, ma.bdatetime, ma.service_id, ma.executor_id, ss.is_house_call, ms.main_diagnosis_id, ms.id, ms.admission_date, ms.admission_time, ms.outcome_date, ms.res_group_id, ms.profile_id, mc.id, mc.uid, mc.main_diagnos_id, mc.open_date, mc.closing_step_id, mc.close_date, mc.is_finance_type_control, mc.is_social_significant, mc.patient_id, mc.rankin_scale_for_admission_id, mc.external_reason_mkb_id, mc.referral_id, mar.id, mar.code, mar.name, mar.external_reason_input_is_allowed, pv.place_id, pv.initiator_id, pv.dental_formula_id, pv.goal_id, mct.id, mct.name, mcr.id, mcr.name, mpm.id, mpm.name, mcpf.id, mcpf.name, ffst.id, ffst.name, mcpc.id, mcpc.name, mcl.id, mcl.name, mcig.id, mcig.code, mcig.name, srgrg.id, peprg.id, perg.note, pirg.surname, pirg.name, pirg.patr_name
  • Buffers: shared hit=68
205. 0.025 1.299 ↑ 1.0 1 1

Nested Loop Left Join (cost=6.81..48.01 rows=1 width=719) (actual time=0.321..1.299 rows=1 loops=1)

  • Output: ssr.id, ssr.customer_id, ssr.service_id, ssr.bdate, ssr.res_group_id, ssr.org_id, ma.id, ma.bdatetime, ma.service_id, ma.executor_id, ss.is_house_call, ms.main_diagnosis_id, ms.id, ms.admission_date, ms.admission_time, ms.outcome_date, ms.res_group_id, ms.profile_id, mc.id, mc.uid, mc.main_diagnos_id, mc.open_date, mc.closing_step_id, mc.close_date, mc.is_finance_type_control, mc.is_social_significant, mc.patient_id, mc.rankin_scale_for_admission_id, mc.external_reason_mkb_id, mc.referral_id, mar.id, mar.code, mar.name, mar.external_reason_input_is_allowed, pv.place_id, pv.initiator_id, pv.dental_formula_id, pv.goal_id, mct.id, mct.name, mcr.id, mcr.name, mpm.id, mpm.name, mcpf.id, mcpf.name, ffst.id, ffst.name, mcpc.id, mcpc.name, mcl.id, mcl.name, mcig.id, mcig.code, mcig.name, srgrg.id, peprg.id, perg.note, perg.individual_id
  • Buffers: shared hit=64
206. 0.034 1.240 ↑ 1.0 1 1

Nested Loop Left Join (cost=6.52..47.65 rows=1 width=711) (actual time=0.307..1.240 rows=1 loops=1)

  • Output: ssr.id, ssr.customer_id, ssr.service_id, ssr.bdate, ssr.res_group_id, ssr.org_id, ma.id, ma.bdatetime, ma.service_id, ma.executor_id, ss.is_house_call, ms.main_diagnosis_id, ms.id, ms.admission_date, ms.admission_time, ms.outcome_date, ms.res_group_id, ms.profile_id, mc.id, mc.uid, mc.main_diagnos_id, mc.open_date, mc.closing_step_id, mc.close_date, mc.is_finance_type_control, mc.is_social_significant, mc.patient_id, mc.rankin_scale_for_admission_id, mc.external_reason_mkb_id, mc.referral_id, mar.id, mar.code, mar.name, mar.external_reason_input_is_allowed, pv.place_id, pv.initiator_id, pv.dental_formula_id, pv.goal_id, mct.id, mct.name, mcr.id, mcr.name, mpm.id, mpm.name, mcpf.id, mcpf.name, ffst.id, ffst.name, mcpc.id, mcpc.name, mcl.id, mcl.name, mcig.id, mcig.code, mcig.name, srgrg.id, peprg.id, peprg.employee_id
  • Buffers: shared hit=61
207. 0.026 1.172 ↑ 1.0 1 1

Nested Loop Left Join (cost=6.23..47.34 rows=1 width=707) (actual time=0.293..1.172 rows=1 loops=1)

  • Output: ssr.id, ssr.customer_id, ssr.service_id, ssr.bdate, ssr.res_group_id, ssr.org_id, ma.id, ma.bdatetime, ma.service_id, ma.executor_id, ss.is_house_call, ms.main_diagnosis_id, ms.id, ms.admission_date, ms.admission_time, ms.outcome_date, ms.res_group_id, ms.profile_id, mc.id, mc.uid, mc.main_diagnos_id, mc.open_date, mc.closing_step_id, mc.close_date, mc.is_finance_type_control, mc.is_social_significant, mc.patient_id, mc.rankin_scale_for_admission_id, mc.external_reason_mkb_id, mc.referral_id, mar.id, mar.code, mar.name, mar.external_reason_input_is_allowed, pv.place_id, pv.initiator_id, pv.dental_formula_id, pv.goal_id, mct.id, mct.name, mcr.id, mcr.name, mpm.id, mpm.name, mcpf.id, mcpf.name, ffst.id, ffst.name, mcpc.id, mcpc.name, mcl.id, mcl.name, mcig.id, mcig.code, mcig.name, srgrg.id, srgrg.responsible_id
  • Buffers: shared hit=58
208. 0.027 1.107 ↑ 1.0 1 1

Nested Loop Left Join (cost=5.66..46.48 rows=1 width=699) (actual time=0.273..1.107 rows=1 loops=1)

  • Output: ssr.id, ssr.customer_id, ssr.service_id, ssr.bdate, ssr.res_group_id, ssr.org_id, ma.id, ma.bdatetime, ma.service_id, ma.executor_id, ss.is_house_call, ms.main_diagnosis_id, ms.id, ms.admission_date, ms.admission_time, ms.outcome_date, ms.res_group_id, ms.profile_id, mc.id, mc.uid, mc.main_diagnos_id, mc.open_date, mc.closing_step_id, mc.close_date, mc.is_finance_type_control, mc.is_social_significant, mc.patient_id, mc.rankin_scale_for_admission_id, mc.external_reason_mkb_id, mc.referral_id, mar.id, mar.code, mar.name, mar.external_reason_input_is_allowed, pv.place_id, pv.initiator_id, pv.dental_formula_id, pv.goal_id, mct.id, mct.name, mcr.id, mcr.name, mpm.id, mpm.name, mcpf.id, mcpf.name, ffst.id, ffst.name, mcpc.id, mcpc.name, mcl.id, mcl.name, mcig.id, mcig.code, mcig.name
  • Buffers: shared hit=53
209. 0.027 1.052 ↑ 1.0 1 1

Nested Loop Left Join (cost=5.52..46.31 rows=1 width=621) (actual time=0.263..1.052 rows=1 loops=1)

  • Output: ssr.id, ssr.customer_id, ssr.service_id, ssr.bdate, ssr.res_group_id, ssr.org_id, ma.id, ma.bdatetime, ma.service_id, ma.executor_id, ss.is_house_call, ms.main_diagnosis_id, ms.id, ms.admission_date, ms.admission_time, ms.outcome_date, ms.res_group_id, ms.profile_id, mc.id, mc.uid, mc.main_diagnos_id, mc.open_date, mc.closing_step_id, mc.close_date, mc.is_finance_type_control, mc.is_social_significant, mc.patient_id, mc.rankin_scale_for_admission_id, mc.init_goal_id, mc.external_reason_mkb_id, mc.referral_id, mar.id, mar.code, mar.name, mar.external_reason_input_is_allowed, pv.place_id, pv.initiator_id, pv.dental_formula_id, pv.goal_id, mct.id, mct.name, mcr.id, mcr.name, mpm.id, mpm.name, mcpf.id, mcpf.name, ffst.id, ffst.name, mcpc.id, mcpc.name, mcl.id, mcl.name
  • Buffers: shared hit=51
210. 0.033 0.990 ↑ 1.0 1 1

Nested Loop Left Join (cost=5.38..46.15 rows=1 width=548) (actual time=0.254..0.990 rows=1 loops=1)

  • Output: ssr.id, ssr.customer_id, ssr.service_id, ssr.bdate, ssr.res_group_id, ssr.org_id, ma.id, ma.bdatetime, ma.service_id, ma.executor_id, ss.is_house_call, ms.main_diagnosis_id, ms.id, ms.admission_date, ms.admission_time, ms.outcome_date, ms.res_group_id, ms.profile_id, mc.id, mc.uid, mc.main_diagnos_id, mc.open_date, mc.closing_step_id, mc.close_date, mc.is_finance_type_control, mc.is_social_significant, mc.patient_id, mc.rankin_scale_for_admission_id, mc.care_level_id, mc.init_goal_id, mc.external_reason_mkb_id, mc.referral_id, mar.id, mar.code, mar.name, mar.external_reason_input_is_allowed, pv.place_id, pv.initiator_id, pv.dental_formula_id, pv.goal_id, mct.id, mct.name, mcr.id, mcr.name, mpm.id, mpm.name, mcpf.id, mcpf.name, ffst.id, ffst.name, mcpc.id, mcpc.name
  • Buffers: shared hit=49
211. 0.026 0.957 ↑ 1.0 1 1

Nested Loop Left Join (cost=5.25..45.99 rows=1 width=522) (actual time=0.252..0.957 rows=1 loops=1)

  • Output: ssr.id, ssr.customer_id, ssr.service_id, ssr.bdate, ssr.res_group_id, ssr.org_id, ma.id, ma.bdatetime, ma.service_id, ma.executor_id, ss.is_house_call, ms.main_diagnosis_id, ms.id, ms.admission_date, ms.admission_time, ms.outcome_date, ms.res_group_id, ms.profile_id, mc.id, mc.uid, mc.main_diagnos_id, mc.open_date, mc.closing_step_id, mc.close_date, mc.is_finance_type_control, mc.is_social_significant, mc.patient_id, mc.rankin_scale_for_admission_id, mc.provision_condition_id, mc.care_level_id, mc.init_goal_id, mc.external_reason_mkb_id, mc.referral_id, mar.id, mar.code, mar.name, mar.external_reason_input_is_allowed, pv.place_id, pv.initiator_id, pv.dental_formula_id, pv.goal_id, mct.id, mct.name, mcr.id, mcr.name, mpm.id, mpm.name, mcpf.id, mcpf.name, ffst.id, ffst.name
  • Buffers: shared hit=49
212. 0.037 0.880 ↑ 1.0 1 1

Nested Loop Left Join (cost=5.12..45.83 rows=1 width=493) (actual time=0.244..0.880 rows=1 loops=1)

  • Output: ssr.id, ssr.customer_id, ssr.service_id, ssr.bdate, ssr.res_group_id, ssr.org_id, ma.id, ma.bdatetime, ma.service_id, ma.executor_id, ss.is_house_call, ms.main_diagnosis_id, ms.id, ms.admission_date, ms.admission_time, ms.outcome_date, ms.res_group_id, ms.profile_id, mc.id, mc.uid, mc.main_diagnos_id, mc.open_date, mc.closing_step_id, mc.close_date, mc.is_finance_type_control, mc.is_social_significant, mc.patient_id, mc.rankin_scale_for_admission_id, mc.funding_id, mc.provision_condition_id, mc.care_level_id, mc.init_goal_id, mc.external_reason_mkb_id, mc.referral_id, mar.id, mar.code, mar.name, mar.external_reason_input_is_allowed, pv.place_id, pv.initiator_id, pv.dental_formula_id, pv.goal_id, mct.id, mct.name, mcr.id, mcr.name, mpm.id, mpm.name, mcpf.id, mcpf.name
  • Buffers: shared hit=47
213. 0.024 0.816 ↑ 1.0 1 1

Nested Loop Left Join (cost=4.99..45.67 rows=1 width=474) (actual time=0.234..0.816 rows=1 loops=1)

  • Output: ssr.id, ssr.customer_id, ssr.service_id, ssr.bdate, ssr.res_group_id, ssr.org_id, ma.id, ma.bdatetime, ma.service_id, ma.executor_id, ss.is_house_call, ms.main_diagnosis_id, ms.id, ms.admission_date, ms.admission_time, ms.outcome_date, ms.res_group_id, ms.profile_id, mc.id, mc.uid, mc.main_diagnos_id, mc.open_date, mc.closing_step_id, mc.close_date, mc.is_finance_type_control, mc.is_social_significant, mc.patient_id, mc.rankin_scale_for_admission_id, mc.care_providing_form_id, mc.funding_id, mc.provision_condition_id, mc.care_level_id, mc.init_goal_id, mc.external_reason_mkb_id, mc.referral_id, mar.id, mar.code, mar.name, mar.external_reason_input_is_allowed, pv.place_id, pv.initiator_id, pv.dental_formula_id, pv.goal_id, mct.id, mct.name, mcr.id, mcr.name, mpm.id, mpm.name
  • Buffers: shared hit=45
214. 0.028 0.791 ↑ 1.0 1 1

Nested Loop Left Join (cost=4.85..45.51 rows=1 width=342) (actual time=0.231..0.791 rows=1 loops=1)

  • Output: ssr.id, ssr.customer_id, ssr.service_id, ssr.bdate, ssr.res_group_id, ssr.org_id, ma.id, ma.bdatetime, ma.service_id, ma.executor_id, ss.is_house_call, ms.main_diagnosis_id, ms.id, ms.admission_date, ms.admission_time, ms.outcome_date, ms.res_group_id, ms.profile_id, mc.id, mc.uid, mc.main_diagnos_id, mc.open_date, mc.closing_step_id, mc.close_date, mc.is_finance_type_control, mc.is_social_significant, mc.patient_id, mc.rankin_scale_for_admission_id, mc.payment_method_id, mc.care_providing_form_id, mc.funding_id, mc.provision_condition_id, mc.care_level_id, mc.init_goal_id, mc.external_reason_mkb_id, mc.referral_id, mar.id, mar.code, mar.name, mar.external_reason_input_is_allowed, pv.place_id, pv.initiator_id, pv.dental_formula_id, pv.goal_id, mct.id, mct.name, mcr.id, mcr.name
  • Buffers: shared hit=45
215. 0.023 0.731 ↑ 1.0 1 1

Nested Loop Left Join (cost=4.72..45.35 rows=1 width=301) (actual time=0.220..0.731 rows=1 loops=1)

  • Output: ssr.id, ssr.customer_id, ssr.service_id, ssr.bdate, ssr.res_group_id, ssr.org_id, ma.id, ma.bdatetime, ma.service_id, ma.executor_id, ss.is_house_call, ms.main_diagnosis_id, ms.id, ms.admission_date, ms.admission_time, ms.outcome_date, ms.res_group_id, ms.profile_id, mc.id, mc.uid, mc.main_diagnos_id, mc.open_date, mc.closing_step_id, mc.close_date, mc.is_finance_type_control, mc.is_social_significant, mc.patient_id, mc.rankin_scale_for_admission_id, mc.care_regimen_id, mc.payment_method_id, mc.care_providing_form_id, mc.funding_id, mc.provision_condition_id, mc.care_level_id, mc.init_goal_id, mc.external_reason_mkb_id, mc.referral_id, mar.id, mar.code, mar.name, mar.external_reason_input_is_allowed, pv.place_id, pv.initiator_id, pv.dental_formula_id, pv.goal_id, mct.id, mct.name
  • Buffers: shared hit=43
216. 0.038 0.676 ↑ 1.0 1 1

Nested Loop Left Join (cost=4.58..45.19 rows=1 width=246) (actual time=0.211..0.676 rows=1 loops=1)

  • Output: ssr.id, ssr.customer_id, ssr.service_id, ssr.bdate, ssr.res_group_id, ssr.org_id, ma.id, ma.bdatetime, ma.service_id, ma.executor_id, ss.is_house_call, ms.main_diagnosis_id, ms.id, ms.admission_date, ms.admission_time, ms.outcome_date, ms.res_group_id, ms.profile_id, mc.id, mc.uid, mc.main_diagnos_id, mc.open_date, mc.closing_step_id, mc.close_date, mc.is_finance_type_control, mc.is_social_significant, mc.patient_id, mc.rankin_scale_for_admission_id, mc.case_type_id, mc.care_regimen_id, mc.payment_method_id, mc.care_providing_form_id, mc.funding_id, mc.provision_condition_id, mc.care_level_id, mc.init_goal_id, mc.external_reason_mkb_id, mc.referral_id, mar.id, mar.code, mar.name, mar.external_reason_input_is_allowed, pv.place_id, pv.initiator_id, pv.dental_formula_id, pv.goal_id
  • Buffers: shared hit=41
217. 0.035 0.592 ↑ 1.0 1 1

Nested Loop Left Join (cost=4.15..44.66 rows=1 width=230) (actual time=0.190..0.592 rows=1 loops=1)

  • Output: ssr.id, ssr.customer_id, ssr.service_id, ssr.bdate, ssr.res_group_id, ssr.org_id, ma.id, ma.bdatetime, ma.service_id, ma.executor_id, ss.is_house_call, ms.main_diagnosis_id, ms.id, ms.admission_date, ms.admission_time, ms.outcome_date, ms.res_group_id, ms.profile_id, mc.id, mc.uid, mc.main_diagnos_id, mc.open_date, mc.closing_step_id, mc.close_date, mc.is_finance_type_control, mc.is_social_significant, mc.patient_id, mc.rankin_scale_for_admission_id, mc.case_type_id, mc.care_regimen_id, mc.payment_method_id, mc.care_providing_form_id, mc.funding_id, mc.provision_condition_id, mc.care_level_id, mc.init_goal_id, mc.external_reason_mkb_id, mc.referral_id, mar.id, mar.code, mar.name, mar.external_reason_input_is_allowed
  • Buffers: shared hit=37
218. 0.045 0.556 ↑ 1.0 1 1

Nested Loop Left Join (cost=4.01..44.49 rows=1 width=160) (actual time=0.186..0.556 rows=1 loops=1)

  • Output: ssr.id, ssr.customer_id, ssr.service_id, ssr.bdate, ssr.res_group_id, ssr.org_id, ma.id, ma.bdatetime, ma.service_id, ma.executor_id, ss.is_house_call, ms.main_diagnosis_id, ms.id, ms.admission_date, ms.admission_time, ms.outcome_date, ms.res_group_id, ms.profile_id, mc.id, mc.uid, mc.main_diagnos_id, mc.open_date, mc.closing_step_id, mc.close_date, mc.is_finance_type_control, mc.is_social_significant, mc.patient_id, mc.rankin_scale_for_admission_id, mc.admission_reason_id, mc.case_type_id, mc.care_regimen_id, mc.payment_method_id, mc.care_providing_form_id, mc.funding_id, mc.provision_condition_id, mc.care_level_id, mc.init_goal_id, mc.external_reason_mkb_id, mc.referral_id
  • Buffers: shared hit=37
219. 0.022 0.454 ↑ 1.0 1 1

Nested Loop Left Join (cost=3.57..43.93 rows=1 width=81) (actual time=0.152..0.454 rows=1 loops=1)

  • Output: ssr.id, ssr.customer_id, ssr.service_id, ssr.bdate, ssr.res_group_id, ssr.org_id, ma.id, ma.bdatetime, ma.service_id, ma.executor_id, ss.is_house_call, ms.main_diagnosis_id, ms.id, ms.admission_date, ms.admission_time, ms.outcome_date, ms.res_group_id, ms.profile_id, ms.case_id
  • Buffers: shared hit=33
220. 0.029 0.383 ↑ 1.0 1 1

Nested Loop Left Join (cost=3.14..35.46 rows=1 width=49) (actual time=0.132..0.383 rows=1 loops=1)

  • Output: ssr.id, ssr.customer_id, ssr.service_id, ssr.bdate, ssr.res_group_id, ssr.org_id, msr.step_id, ma.id, ma.bdatetime, ma.service_id, ma.executor_id, ss.is_house_call
  • Buffers: shared hit=29
221. 0.009 0.315 ↑ 1.0 1 1

Nested Loop Left Join (cost=2.57..34.76 rows=1 width=52) (actual time=0.113..0.315 rows=1 loops=1)

  • Output: ssr.id, ssr.customer_id, ssr.service_id, ssr.bdate, ssr.res_group_id, ssr.org_id, msr.step_id, ma.id, ma.bdatetime, ma.service_id, ma.executor_id, sst.session_id
  • Buffers: shared hit=24
222. 0.032 0.265 ↑ 1.0 1 1

Nested Loop Left Join (cost=2.13..34.24 rows=1 width=52) (actual time=0.096..0.265 rows=1 loops=1)

  • Output: ssr.id, ssr.customer_id, ssr.service_id, ssr.bdate, ssr.res_group_id, ssr.org_id, msr.step_id, ma.id, ma.bdatetime, ma.service_id, ma.executor_id, st.id
  • Buffers: shared hit=20
223. 0.043 0.196 ↑ 1.0 1 1

Nested Loop Left Join (cost=1.70..25.77 rows=1 width=48) (actual time=0.073..0.196 rows=1 loops=1)

  • Output: ssr.id, ssr.customer_id, ssr.service_id, ssr.bdate, ssr.res_group_id, ssr.org_id, msr.step_id, ma.id, ma.bdatetime, ma.service_id, ma.executor_id
  • Join Filter: (ssr.id = ma.srv_rendered_id)
  • Buffers: shared hit=15
224. 0.020 0.111 ↑ 1.0 1 1

Nested Loop (cost=1.14..17.18 rows=1 width=28) (actual time=0.047..0.111 rows=1 loops=1)

  • Output: ssr.id, ssr.customer_id, ssr.service_id, ssr.bdate, ssr.res_group_id, ssr.org_id, msr.step_id
  • Buffers: shared hit=10
225. 0.044 0.044 ↑ 1.0 1 1

Index Scan using sr_srv_rendered_pk on public.sr_srv_rendered ssr (cost=0.57..8.59 rows=1 width=24) (actual time=0.026..0.044 rows=1 loops=1)

  • Output: ssr.id, ssr.bdate, ssr.comment, ssr.cost, ssr.duration, ssr.edate, ssr.is_rendered, ssr.quantity, ssr.total_cost, ssr.contract_id, ssr.customer_id, ssr.funding_id, ssr.res_group_id, ssr.service_id, ssr.duration_measure_unit_id, ssr.begin_time, ssr.prototype_id, ssr.org_id, ssr.price_list_id, ssr.cul, ssr.parent_id, ssr.payment_status_id, ssr.root_service_id, ssr.is_wholly_rendered, ssr.planned_date, ssr.planned_time, ssr.tooth_number, ssr.is_refused, ssr.aud_who, ssr.aud_when, ssr.aud_source, ssr.aud_who_create, ssr.aud_when_create, ssr.aud_source_create, ssr.is_amalgam_filling, ssr.is_mobile_medical_teams, ssr.close_date, ssr.complex_srv_id, ssr.for_upload, ssr.uid, ssr.is_need_consulting
  • Index Cond: (ssr.id = 74820968)
  • Buffers: shared hit=5
226. 0.047 0.047 ↑ 1.0 1 1

Index Scan using md_srv_rendered_pk on public.md_srv_rendered msr (cost=0.57..8.59 rows=1 width=8) (actual time=0.016..0.047 rows=1 loops=1)

  • Output: msr.id, msr.is_urgent, msr.is_use_cryogenic, msr.is_use_endoscopic, msr.is_use_laser, msr.anesthesia_type_id, msr.step_id, msr.complication_type_id, msr.diagnosis_id, msr.case_id, msr.referral_id, msr.result_category_id, msr.patient_prescription_id, msr.health_group_id, msr.vmp_type_id, msr.vmp_method_id, msr.anatomic_zone_id, msr.aud_who, msr.aud_when, msr.aud_source, msr.aud_who_create, msr.aud_when_create, msr.aud_source_create, msr.prescription_id, msr.by_standard, msr.complicated_value, msr.vmp_profile_id
  • Index Cond: (msr.id = 74820968)
  • Buffers: shared hit=5
227. 0.042 0.042 ↑ 1.0 1 1

Index Scan using md_appointment_srv_rendered_id_idx on public.md_appointment ma (cost=0.56..8.58 rows=1 width=24) (actual time=0.020..0.042 rows=1 loops=1)

  • Output: ma.id, ma.srv_rendered_id, ma.executor_id, ma.bdatetime, ma.customer_id, ma.funding_id, ma.state_id, ma.service_id, ma.cancel_reason_id, ma.care_regimen_id, ma.care_level_id, ma.referral_id, ma.source_id, ma.registrator_id, ma.registration_dt, ma.edatetime, ma.is_urgent, ma.notif_contact, ma.price_list_id, ma.message, ma.queue_state_id, ma.queue_change_dt, ma.ticket_number, ma.price, ma.init_goal_id, ma.organization_id, ma.is_house_call, ma.comment, ma.aud_who, ma.aud_when, ma.aud_source, ma.aud_who_create, ma.aud_when_create, ma.aud_source_create, ma.reject_comment, ma.reject_reason_id, ma.way_id, ma.is_cito, ma.event_id, ma.is_send_message, ma.comment_send_message, ma.cancel_dt, ma.answer_portal_code
  • Index Cond: (ma.srv_rendered_id = 74820968)
  • Buffers: shared hit=5
228. 0.037 0.037 ↑ 1.0 1 1

Index Only Scan using sr_ticket_pk on public.sr_ticket st (cost=0.44..8.46 rows=1 width=4) (actual time=0.021..0.037 rows=1 loops=1)

  • Output: st.id
  • Index Cond: (st.id = ma.id)
  • Heap Fetches: 1
  • Buffers: shared hit=5
229. 0.041 0.041 ↑ 1.0 1 1

Index Scan using sr_session_ticket_ticket_id_idx on public.sr_session_ticket sst (cost=0.44..0.51 rows=1 width=8) (actual time=0.015..0.041 rows=1 loops=1)

  • Output: sst.session_id, sst.ticket_id, sst.aud_who, sst.aud_when, sst.aud_source, sst.aud_who_create, sst.aud_when_create, sst.aud_source_create
  • Index Cond: (st.id = sst.ticket_id)
  • Buffers: shared hit=4
230. 0.039 0.039 ↑ 1.0 1 1

Index Scan using sr_session_pk on public.sr_session ss (cost=0.56..0.70 rows=1 width=5) (actual time=0.017..0.039 rows=1 loops=1)

  • Output: ss.id, ss.bdatetime, ss.edatetime, ss.time_type_id, ss.shift_id, ss.is_house_call, ss.aud_who, ss.aud_when, ss.aud_source, ss.aud_who_create, ss.aud_when_create, ss.aud_source_create, ss.eboard_prohibited, ss.session_number, ss.ticket_counter
  • Index Cond: (sst.session_id = ss.id)
  • Buffers: shared hit=5
231. 0.049 0.049 ↑ 1.0 1 1

Index Scan using mc_step_pk on public.mc_step ms (cost=0.44..8.46 rows=1 width=36) (actual time=0.019..0.049 rows=1 loops=1)

  • Output: ms.id, ms.admission_date, ms.admission_time, ms.death_date, ms.death_time, ms.outcome_date, ms.outcome_time, ms.death_employee_id, ms.main_diagnosis_id, ms.case_id, ms.outcome_id, ms.outcome_clinic_id, ms.outcome_regimen_id, ms.regimen_id, ms.res_group_id, ms.result_id, ms.reason_id, ms.profile_id, ms.mes_id, ms.mes_quality_criterion_id, ms.is_continue, ms.is_continue_editable, ms.standard_id, ms.csg_id, ms.vmp_type_id, ms.vmp_method_id, ms.deviation_reason_id, ms.aud_who, ms.aud_when, ms.aud_source, ms.aud_who_create, ms.aud_when_create, ms.aud_source_create, ms._clinic_id, ms._patient_id, ms.planned_date_closing_case, ms.gestational_age, ms.onko_stage, ms.hsp_bed_profile_id, ms.is_first_step
  • Index Cond: (msr.step_id = ms.id)
  • Buffers: shared hit=4
232. 0.057 0.057 ↑ 1.0 1 1

Index Scan using mc_case_pk on public.mc_case mc (cost=0.44..0.56 rows=1 width=83) (actual time=0.031..0.057 rows=1 loops=1)

  • Output: mc.id, mc.uid, mc.main_diagnos_id, mc.open_date, mc.closing_step_id, mc.close_date, mc.is_finance_type_control, mc.is_social_significant, mc.patient_id, mc.rankin_scale_for_admission_id, mc.admission_reason_id, mc.case_type_id, mc.care_regimen_id, mc.payment_method_id, mc.care_providing_form_id, mc.funding_id, mc.provision_condition_id, mc.care_level_id, mc.init_goal_id, mc.external_reason_mkb_id, mc.referral_id
  • Index Cond: (ms.case_id = mc.id)
  • Buffers: shared hit=4
233. 0.001 0.001 ↓ 0.0 0 1

Index Scan using mc_admission_reason_pk on public.mc_admission_reason mar (cost=0.14..0.15 rows=1 width=74) (actual time=0.001..0.001 rows=0 loops=1)

  • Output: mar.id, mar.code, mar.name, mar.e_code, mar.is_injury, mar.aud_who, mar.aud_when, mar.aud_source, mar.aud_who_create, mar.aud_when_create, mar.aud_source_create, mar.from_dt, mar.to_dt, mar.external_reason_input_is_allowed
  • Index Cond: (mc.admission_reason_id = mar.id)
234. 0.046 0.046 ↑ 1.0 1 1

Index Scan using plc_visit_pk on public.plc_visit pv (cost=0.44..0.52 rows=1 width=20) (actual time=0.018..0.046 rows=1 loops=1)

  • Output: pv.id, pv.duration, pv.goal_id, pv.initiator_id, pv.place_id, pv.type_id, pv.is_viewed, pv.is_needed, pv.is_sanitized, pv.aud_who, pv.aud_when, pv.aud_source, pv.aud_who_create, pv.aud_when_create, pv.aud_source_create, pv.dental_formula_id, pv.appointment_id, pv.planned_date
  • Index Cond: (ms.id = pv.id)
  • Buffers: shared hit=4
235. 0.032 0.032 ↑ 1.0 1 1

Index Scan using mc_case_type_pk on public.mc_case_type mct (cost=0.13..0.15 rows=1 width=59) (actual time=0.007..0.032 rows=1 loops=1)

  • Output: mct.id, mct.case_mode_id, mct.code, mct.name, mct.default_regimen_id, mct.e_code, mct.aud_who, mct.aud_when, mct.aud_source, mct.aud_who_create, mct.aud_when_create, mct.aud_source_create, mct.from_dt, mct.to_dt, mct.billing_code
  • Index Cond: (mc.case_type_id = mct.id)
  • Buffers: shared hit=2
236. 0.032 0.032 ↑ 1.0 1 1

Index Scan using mc_care_regimen_pk on public.mc_care_regimen mcr (cost=0.13..0.15 rows=1 width=45) (actual time=0.006..0.032 rows=1 loops=1)

  • Output: mcr.id, mcr.bdate, mcr.is_bed_required, mcr.case_mode_id, mcr.med_cert_name, mcr.code, mcr.edate, mcr.name, mcr.e_code, mcr.aud_who, mcr.aud_when, mcr.aud_source, mcr.aud_who_create, mcr.aud_when_create, mcr.aud_source_create, mcr.from_dt, mcr.to_dt, mcr.is_not_admission, mcr.billing_code
  • Index Cond: (mc.care_regimen_id = mcr.id)
  • Buffers: shared hit=2
237. 0.001 0.001 ↓ 0.0 0 1

Index Scan using mc_payment_method_pk on public.mc_payment_method mpm (cost=0.14..0.16 rows=1 width=136) (actual time=0.001..0.001 rows=0 loops=1)

  • Output: mpm.id, mpm.code, mpm.name, mpm.e_code, mpm.aud_who, mpm.aud_when, mpm.aud_source, mpm.aud_who_create, mpm.aud_when_create, mpm.aud_source_create, mpm.from_dt, mpm.to_dt, mpm.billing_code
  • Index Cond: (mc.payment_method_id = mpm.id)
238. 0.027 0.027 ↑ 1.0 1 1

Index Scan using md_care_providing_form_pk on public.md_care_providing_form mcpf (cost=0.13..0.15 rows=1 width=23) (actual time=0.007..0.027 rows=1 loops=1)

  • Output: mcpf.id, mcpf.code, mcpf.name, mcpf.e_code, mcpf.aud_who, mcpf.aud_when, mcpf.aud_source, mcpf.aud_who_create, mcpf.aud_when_create, mcpf.aud_source_create, mcpf.from_dt, mcpf.to_dt, mcpf.billing_code
  • Index Cond: (mc.care_providing_form_id = mcpf.id)
  • Buffers: shared hit=2
239. 0.051 0.051 ↑ 1.0 1 1

Index Scan using fin_funding_source_type_pk on public.fin_funding_source_type ffst (cost=0.13..0.15 rows=1 width=33) (actual time=0.006..0.051 rows=1 loops=1)

  • Output: ffst.id, ffst.bdate, ffst.code, ffst.edate, ffst.name, ffst.ordern, ffst.parent_id, ffst.has_exception, ffst.e_code, ffst.is_contract_required, ffst.is_citizen, ffst.is_payer_smo, ffst.is_payer_foms, ffst.is_default, ffst.is_privileged, ffst.aud_who, ffst.aud_when, ffst.aud_source, ffst.aud_who_create, ffst.aud_when_create, ffst.aud_source_create, ffst.from_dt, ffst.to_dt, ffst.is_vmp, ffst.billing_code
  • Index Cond: (mc.funding_id = ffst.id)
  • Buffers: shared hit=2
240. 0.000 0.000 ↓ 0.0 0 1

Index Scan using md_care_provision_condition_pk on public.md_care_provision_condition mcpc (cost=0.13..0.15 rows=1 width=30) (actual time=0.000..0.000 rows=0 loops=1)

  • Output: mcpc.id, mcpc.code, mcpc.name, mcpc.begin_date, mcpc.end_date, mcpc.e_code, mcpc.aud_who, mcpc.aud_when, mcpc.aud_source, mcpc.aud_who_create, mcpc.aud_when_create, mcpc.aud_source_create, mcpc.from_dt, mcpc.to_dt
  • Index Cond: (mc.provision_condition_id = mcpc.id)
241. 0.035 0.035 ↑ 1.0 1 1

Index Scan using mc_care_level_pk on public.mc_care_level mcl (cost=0.14..0.15 rows=1 width=77) (actual time=0.006..0.035 rows=1 loops=1)

  • Output: mcl.id, mcl.bdate, mcl.code, mcl.edate, mcl.name, mcl.e_code, mcl.vmp_flag, mcl.icon_code, mcl.parent_id, mcl.aud_who, mcl.aud_when, mcl.aud_source, mcl.aud_who_create, mcl.aud_when_create, mcl.aud_source_create, mcl.from_dt, mcl.to_dt, mcl.billing_code
  • Index Cond: (mc.care_level_id = mcl.id)
  • Buffers: shared hit=2
242. 0.028 0.028 ↑ 1.0 1 1

Index Scan using mc_case_init_goal_pk on public.mc_case_init_goal mcig (cost=0.14..0.16 rows=1 width=82) (actual time=0.008..0.028 rows=1 loops=1)

  • Output: mcig.id, mcig.code, mcig.name, mcig.visit_type_id, mcig.e_code, mcig.aud_who, mcig.aud_when, mcig.aud_source, mcig.aud_who_create, mcig.aud_when_create, mcig.aud_source_create, mcig.from_dt, mcig.to_dt, mcig.billing_code
  • Index Cond: (mc.init_goal_id = mcig.id)
  • Buffers: shared hit=2
243. 0.039 0.039 ↑ 1.0 1 1

Index Scan using sr_res_group_pk on public.sr_res_group srgrg (cost=0.57..0.85 rows=1 width=8) (actual time=0.017..0.039 rows=1 loops=1)

  • Output: srgrg.id, srgrg.bdate, srgrg.edate, srgrg.is_system, srgrg.name, srgrg.department_id, srgrg.org_id, srgrg.responsible_id, srgrg.is_available_in_electronic_queue, srgrg.label_id, srgrg.ignore_regclinic_check, srgrg.note, srgrg.blocked, srgrg.block_comment, srgrg.template_res_group_id, srgrg.aud_who, srgrg.aud_when, srgrg.aud_source, srgrg.aud_who_create, srgrg.aud_when_create, srgrg.aud_source_create, srgrg.emergency, srgrg.ignore_districts, srgrg.service_template_id
  • Index Cond: (ms.res_group_id = srgrg.id)
  • Buffers: shared hit=5
244. 0.034 0.034 ↑ 1.0 1 1

Index Scan using pim_employee_position_pk on public.pim_employee_position peprg (cost=0.29..0.31 rows=1 width=8) (actual time=0.012..0.034 rows=1 loops=1)

  • Output: peprg.id, peprg.dismissal_order_code, peprg.start_date, peprg.hiring_order_code, peprg.rate, peprg.end_date, peprg.dismissal_reason_id, peprg.employee_id, peprg.employment_type_id, peprg.hiring_type_id, peprg.position_id, peprg.position_type_id, peprg.unit_id, peprg.code, peprg.aud_who, peprg.aud_when, peprg.aud_source, peprg.aud_who_create, peprg.aud_when_create, peprg.aud_source_create, peprg.pref_prescription, peprg.extra_payment, peprg.target_training, peprg.leaving_reason_id
  • Index Cond: (srgrg.responsible_id = peprg.id)
  • Buffers: shared hit=3
245. 0.034 0.034 ↑ 1.0 1 1

Index Scan using pim_employee_pk on public.pim_employee perg (cost=0.29..0.35 rows=1 width=16) (actual time=0.011..0.034 rows=1 loops=1)

  • Output: perg.id, perg.note, perg.number, perg.photo, perg.callup_subject_id, perg.individual_id, perg.organization_id, perg.is_dismissed, perg.employment_dt, perg.dismissal_dt, perg.aud_who, perg.aud_when, perg.aud_source, perg.aud_who_create, perg.aud_when_create, perg.aud_source_create, perg.accreditation_id
  • Index Cond: (peprg.employee_id = perg.id)
  • Buffers: shared hit=3
246. 0.039 0.039 ↑ 1.0 1 1

Index Scan using pim_individual_pk on public.pim_individual pirg (cost=0.43..4.18 rows=1 width=53) (actual time=0.014..0.039 rows=1 loops=1)

  • Output: pirg.id, pirg.birth_dt, pirg.death_dt, pirg.has_citizenship, pirg.name, pirg.patr_name, pirg.surname, pirg.gender_id, pirg.nationality_id, pirg.list_identity_doc, pirg.list_oms_doc, pirg.list_job_org, pirg.list_reg_name, pirg.list_snils, pirg.list_uid, pirg.aud_who, pirg.aud_when, pirg.aud_source, pirg.aud_who_create, pirg.aud_when_create, pirg.aud_source_create, pirg.birth_place, pirg.age_year, pirg.age_month, pirg.age_day, pirg.list_main_contact, pirg.is_only_birth_year
  • Index Cond: (perg.individual_id = pirg.id)
  • Buffers: shared hit=4
247. 0.031 0.031 ↑ 1.0 1 1

Index Only Scan using sr_res_group_pk on public.sr_res_group msrg (cost=0.57..8.59 rows=1 width=4) (actual time=0.017..0.031 rows=1 loops=1)

  • Output: msrg.id
  • Index Cond: (msrg.id = ma.executor_id)
  • Heap Fetches: 1
  • Buffers: shared hit=6
248. 0.034 0.034 ↑ 1.0 1 1

Index Scan using sr_res_group_profile_res_group_id_idx on public.sr_res_group_profile srgp (cost=0.29..0.30 rows=1 width=8) (actual time=0.010..0.034 rows=1 loops=1)

  • Output: srgp.id, srgp.res_group_id, srgp.profile_id, srgp.aud_who, srgp.aud_when, srgp.aud_source, srgp.aud_who_create, srgp.aud_when_create, srgp.aud_source_create
  • Index Cond: (msrg.id = srgp.res_group_id)
  • Buffers: shared hit=3
249. 0.033 0.033 ↑ 1.0 1 1

Index Scan using mc_diagnosis_pk on public.mc_diagnosis md (cost=0.56..0.70 rows=1 width=21) (actual time=0.018..0.033 rows=1 loops=1)

  • Output: md.stage_id, md.id, md.is_zno_suspicion, md.disease_type_id, md.diagnos_id, md.injury_reason_id
  • Index Cond: (ms.main_diagnosis_id = md.id)
  • Buffers: shared hit=5
250. 0.030 0.030 ↑ 1.0 1 1

Index Scan using md_diagnosis_pk on public.md_diagnosis md1 (cost=0.29..0.30 rows=1 width=127) (actual time=0.010..0.030 rows=1 loops=1)

  • Output: md1.id, md1.code, md1.name, md1.parent_id, md1.is_injury, md1.level, md1.is_leaf, md1.e_code, md1.oms, md1.stomat, md1.aud_who, md1.aud_when, md1.aud_source, md1.aud_who_create, md1.aud_when_create, md1.aud_source_create, md1.from_dt, md1.to_dt
  • Index Cond: (md.diagnos_id = md1.id)
  • Buffers: shared hit=3
251. 0.000 0.000 ↓ 0.0 0 1

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

  • Output: md2.id, md2.code, md2.name, md2.parent_id, md2.is_injury, md2.level, md2.is_leaf, md2.e_code, md2.oms, md2.stomat, md2.aud_who, md2.aud_when, md2.aud_source, md2.aud_who_create, md2.aud_when_create, md2.aud_source_create, md2.from_dt, md2.to_dt
  • Index Cond: (md.injury_reason_id = md2.id)
252. 0.035 0.035 ↑ 1.0 1 1

Index Scan using sr_service_pk on public.sr_service ssrss (cost=0.42..8.44 rows=1 width=5) (actual time=0.014..0.035 rows=1 loops=1)

  • Output: ssrss.id, ssrss.code, ssrss.cul, ssrss.is_death, ssrss.duration, ssrss.is_fictitious, ssrss.is_independent, ssrss.is_multuplicity, ssrss.name, ssrss.terms, ssrss.org_id, ssrss.category_id, ssrss.duration_unit_id, ssrss.prototype_id, ssrss.type_id, ssrss.from_dt, ssrss.to_dt, ssrss.is_repeated, ssrss.is_inherit_protocol, ssrss.is_expendable_materials, ssrss.is_actual_cul, ssrss.is_paraclinical, ssrss.is_complex, ssrss.accounting_id, ssrss.is_fact, ssrss.is_autocopy_diagnoses, ssrss.is_stomat, ssrss.srg_dif_type_id, ssrss.srg_opr_kind_id, ssrss.is_need_anatomic_zone, ssrss.aud_who, ssrss.aud_when, ssrss.aud_source, ssrss.aud_who_create, ssrss.aud_when_create, ssrss.aud_source_create, ssrss.is_filling, ssrss.is_extraction, ssrss.is_need_close_date, ssrss.is_vmp, ssrss.short_name
  • Index Cond: (ssr.service_id = ssrss.id)
  • Buffers: shared hit=4
253. 0.000 0.000 ↓ 0.0 0 1

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

  • Output: md3.id, md3.code, md3.name, md3.parent_id, md3.is_injury, md3.level, md3.is_leaf, md3.e_code, md3.oms, md3.stomat, md3.aud_who, md3.aud_when, md3.aud_source, md3.aud_who_create, md3.aud_when_create, md3.aud_source_create, md3.from_dt, md3.to_dt
  • Index Cond: (mc.external_reason_mkb_id = md3.id)
254. 0.004 0.004 ↓ 0.0 0 1

Index Only Scan using reg_application_patient_id_ix on d_accounting.reg_application ra (cost=0.14..0.16 rows=1 width=4) (actual time=0.004..0.004 rows=0 loops=1)

  • Output: ra.patient_id
  • Index Cond: (ra.patient_id = mc.patient_id)
  • Heap Fetches: 0
  • Buffers: shared hit=1
255. 0.000 0.000 ↓ 0.0 0 1

Index Scan using md_referral_pk on public.md_referral r (cost=0.43..0.46 rows=1 width=72) (actual time=0.000..0.000 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, r.disease_type_id
  • Index Cond: (r.id = mc.referral_id)
256. 0.001 0.001 ↓ 0.0 0 1

Index Scan using pim_organization_pk on public.pim_organization ref_org (cost=0.29..0.30 rows=1 width=115) (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)
257. 0.000 0.000 ↓ 0.0 0 1

Index Scan using pim_department_pk on public.pim_department ref_dep (cost=0.28..0.30 rows=1 width=62) (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.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, ref_dep.cadastral_number, ref_dep.hospital_mode_id, ref_dep.type_profile_id
  • Index Cond: (ref_dep.id = r.ref_department_id)
258. 0.000 0.000 ↓ 0.0 0 1

Index Scan using md_diagnosis_pk on public.md_diagnosis ref_diag (cost=0.29..0.30 rows=1 width=126) (actual time=0.000..0.000 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)
259.          

SubPlan (for Nested Loop Left Join)

260. 0.004 0.046 ↑ 1.0 1 1

Nested Loop Left Join (cost=2.01..26.13 rows=1 width=4) (actual time=0.043..0.046 rows=1 loops=1)

  • Output: mc1.id
  • Buffers: shared hit=20
261. 0.003 0.033 ↑ 1.0 1 1

Nested Loop Left Join (cost=1.57..25.65 rows=1 width=4) (actual time=0.031..0.033 rows=1 loops=1)

  • Output: ms1.case_id
  • Buffers: shared hit=15
262. 0.004 0.023 ↑ 1.0 1 1

Nested Loop (cost=1.14..17.18 rows=1 width=4) (actual time=0.022..0.023 rows=1 loops=1)

  • Output: msr1.step_id
  • Buffers: shared hit=11
263. 0.012 0.012 ↑ 1.0 1 1

Index Only Scan using sr_srv_rendered_pk on public.sr_srv_rendered ssr1 (cost=0.57..8.59 rows=1 width=4) (actual time=0.012..0.012 rows=1 loops=1)

  • Output: ssr1.id
  • Index Cond: (ssr1.id = ssr.id)
  • Heap Fetches: 1
  • Buffers: shared hit=6
264. 0.007 0.007 ↑ 1.0 1 1

Index Scan using md_srv_rendered_pk on public.md_srv_rendered msr1 (cost=0.57..8.59 rows=1 width=8) (actual time=0.007..0.007 rows=1 loops=1)

  • Output: msr1.id, msr1.is_urgent, msr1.is_use_cryogenic, msr1.is_use_endoscopic, msr1.is_use_laser, msr1.anesthesia_type_id, msr1.step_id, msr1.complication_type_id, msr1.diagnosis_id, msr1.case_id, msr1.referral_id, msr1.result_category_id, msr1.patient_prescription_id, msr1.health_group_id, msr1.vmp_type_id, msr1.vmp_method_id, msr1.anatomic_zone_id, msr1.aud_who, msr1.aud_when, msr1.aud_source, msr1.aud_who_create, msr1.aud_when_create, msr1.aud_source_create, msr1.prescription_id, msr1.by_standard, msr1.complicated_value, msr1.vmp_profile_id
  • Index Cond: (msr1.id = ssr.id)
  • Buffers: shared hit=5
265. 0.007 0.007 ↑ 1.0 1 1

Index Scan using mc_step_pk on public.mc_step ms1 (cost=0.44..8.46 rows=1 width=8) (actual time=0.006..0.007 rows=1 loops=1)

  • Output: ms1.id, ms1.admission_date, ms1.admission_time, ms1.death_date, ms1.death_time, ms1.outcome_date, ms1.outcome_time, ms1.death_employee_id, ms1.main_diagnosis_id, ms1.case_id, ms1.outcome_id, ms1.outcome_clinic_id, ms1.outcome_regimen_id, ms1.regimen_id, ms1.res_group_id, ms1.result_id, ms1.reason_id, ms1.profile_id, ms1.mes_id, ms1.mes_quality_criterion_id, ms1.is_continue, ms1.is_continue_editable, ms1.standard_id, ms1.csg_id, ms1.vmp_type_id, ms1.vmp_method_id, ms1.deviation_reason_id, ms1.aud_who, ms1.aud_when, ms1.aud_source, ms1.aud_who_create, ms1.aud_when_create, ms1.aud_source_create, ms1._clinic_id, ms1._patient_id, ms1.planned_date_closing_case, ms1.gestational_age, ms1.onko_stage, ms1.hsp_bed_profile_id, ms1.is_first_step
  • Index Cond: (msr1.step_id = ms1.id)
  • Buffers: shared hit=4
266. 0.009 0.009 ↑ 1.0 1 1

Index Only Scan using mc_case_pk on public.mc_case mc1 (cost=0.44..0.47 rows=1 width=4) (actual time=0.008..0.009 rows=1 loops=1)

  • Output: mc1.id
  • Index Cond: (mc1.id = ms1.case_id)
  • Heap Fetches: 1
  • Buffers: shared hit=5
267. 0.008 0.026 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.85..16.90 rows=1 width=122) (actual time=0.024..0.026 rows=1 loops=1)

  • Output: (((COALESCE(md1pr.code, ''::character varying))::text || ' '::text) || (COALESCE(md1pr.name, ''::character varying))::text)
  • Buffers: shared hit=8
268. 0.014 0.014 ↑ 1.0 1 1

Index Scan using mc_diagnosis_pk on public.mc_diagnosis mdpr (cost=0.56..8.58 rows=1 width=4) (actual time=0.013..0.014 rows=1 loops=1)

  • Output: mdpr.diagnos_id
  • Index Cond: (mdpr.id = mc.main_diagnos_id)
  • Buffers: shared hit=5
269. 0.004 0.004 ↑ 1.0 1 1

Index Scan using md_diagnosis_pk on public.md_diagnosis md1pr (cost=0.29..8.30 rows=1 width=126) (actual time=0.004..0.004 rows=1 loops=1)

  • Output: md1pr.id, md1pr.code, md1pr.name, md1pr.parent_id, md1pr.is_injury, md1pr.level, md1pr.is_leaf, md1pr.e_code, md1pr.oms, md1pr.stomat, md1pr.aud_who, md1pr.aud_when, md1pr.aud_source, md1pr.aud_who_create, md1pr.aud_when_create, md1pr.aud_source_create, md1pr.from_dt, md1pr.to_dt
  • Index Cond: (mdpr.diagnos_id = md1pr.id)
  • Buffers: shared hit=3
270. 0.014 0.014 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.013..0.014 rows=1 loops=1)

  • Output: row_to_json(ROW(ffst.id, ffst.name))
271. 0.005 0.005 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.005..0.005 rows=1 loops=1)

  • Output: row_to_json(ROW(ffst.id, ffst.name))
272. 0.005 0.005 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.005..0.005 rows=1 loops=1)

  • Output: row_to_json(ROW(mcl.id, mcl.name))
273. 0.004 0.004 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.004..0.004 rows=1 loops=1)

  • Output: row_to_json(ROW(mct.id, mct.name))
274. 0.006 0.006 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.006..0.006 rows=1 loops=1)

  • Output: row_to_json(ROW(mcr.id, mcr.name))
275. 0.004 0.004 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.004..0.004 rows=1 loops=1)

  • Output: row_to_json(ROW(mcpf.id, mcpf.name))
276. 0.008 0.008 ↑ 1.0 1 1

Result (cost=0.00..0.02 rows=1 width=0) (actual time=0.008..0.008 rows=1 loops=1)

  • Output: row_to_json(ROW(mcig.id, (((mcig.code)::text || ' - '::text) || (mcig.name)::text)))
277. 0.004 0.004 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.004..0.004 rows=1 loops=1)

  • Output: row_to_json(ROW(mcpc.id, mcpc.name))
278. 0.006 0.006 ↑ 1.0 1 1

Result (cost=0.00..0.02 rows=1 width=0) (actual time=0.005..0.006 rows=1 loops=1)

  • Output: row_to_json(ROW(mar.id, (((mar.code)::text || ' - '::text) || (mar.name)::text), mar.external_reason_input_is_allowed))
279. 0.004 0.004 ↑ 1.0 1 1

Result (cost=0.00..0.02 rows=1 width=0) (actual time=0.004..0.004 rows=1 loops=1)

  • Output: row_to_json(ROW(md3.id, (((md3.code)::text || ' '::text) || (md3.name)::text)))
280. 0.021 0.021 ↑ 1.0 1 1

Index Scan using pim_individual_pk on public.pim_individual i (cost=0.43..8.45 rows=1 width=49) (actual time=0.021..0.021 rows=1 loops=1)

  • Output: concat_ws(' '::text, i.surname, i.name, i.patr_name)
  • Index Cond: (i.id = mc.patient_id)
  • Buffers: shared hit=4
281. 0.004 0.004 ↑ 1.0 1 1

Index Scan using pim_individual_pk on public.pim_individual pi (cost=0.43..8.45 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=1)

  • Output: pi.gender_id
  • Index Cond: (pi.id = ssr.customer_id)
  • Buffers: shared hit=4
282. 0.008 0.008 ↑ 1.0 1 1

Index Scan using mc_diagnosis_pk on public.mc_diagnosis mc_d (cost=0.56..8.58 rows=1 width=4) (actual time=0.007..0.008 rows=1 loops=1)

  • Output: mc_d.diagnos_id
  • Index Cond: (mc_d.id = ms.main_diagnosis_id)
  • Buffers: shared hit=5
283. 0.000 0.000 ↓ 0.0 0

Index Scan using md_profile_pk on public.md_profile mp1_1 (cost=0.14..8.16 rows=1 width=64) (never executed)

  • Output: mp1_1.name
  • Index Cond: (mp1_1.id = srgp.profile_id)
284. 0.007 0.007 ↑ 1.0 1 1

Index Scan using md_profile_pk on public.md_profile mp1_2 (cost=0.14..8.16 rows=1 width=64) (actual time=0.007..0.007 rows=1 loops=1)

  • Output: mp1_2.name
  • Index Cond: (mp1_2.id = ms.profile_id)
  • Buffers: shared hit=2
285. 0.000 0.061 ↑ 1.0 1 1

Limit (cost=13.21..302.78 rows=1 width=4) (actual time=0.061..0.061 rows=1 loops=1)

  • Output: mdpr_1.id
  • Buffers: shared hit=14
286.          

Initplan (for Limit)

287. 0.001 0.024 ↑ 1.0 1 1

Limit (cost=12.20..12.21 rows=1 width=12) (actual time=0.024..0.024 rows=1 loops=1)

  • Output: (min((ms1_1.admission_date + ms1_1.admission_time)))
  • Buffers: shared hit=4
288. 0.008 0.023 ↑ 1.0 1 1

Aggregate (cost=12.20..12.21 rows=1 width=12) (actual time=0.023..0.023 rows=1 loops=1)

  • Output: min((ms1_1.admission_date + ms1_1.admission_time))
  • Buffers: shared hit=4
289. 0.015 0.015 ↑ 17.0 1 1

Index Scan using idx_mc_step on public.mc_step ms1_1 (cost=0.44..12.12 rows=17 width=12) (actual time=0.014..0.015 rows=1 loops=1)

  • Output: ms1_1.id, ms1_1.admission_date, ms1_1.admission_time, ms1_1.death_date, ms1_1.death_time, ms1_1.outcome_date, ms1_1.outcome_time, ms1_1.death_employee_id, ms1_1.main_diagnosis_id, ms1_1.case_id, ms1_1.outcome_id, ms1_1.outcome_clinic_id, ms1_1.outcome_regimen_id, ms1_1.regimen_id, ms1_1.res_group_id, ms1_1.result_id, ms1_1.reason_id, ms1_1.profile_id, ms1_1.mes_id, ms1_1.mes_quality_criterion_id, ms1_1.is_continue, ms1_1.is_continue_editable, ms1_1.standard_id, ms1_1.csg_id, ms1_1.vmp_type_id, ms1_1.vmp_method_id, ms1_1.deviation_reason_id, ms1_1.aud_who, ms1_1.aud_when, ms1_1.aud_source, ms1_1.aud_who_create, ms1_1.aud_when_create, ms1_1.aud_source_create, ms1_1._clinic_id, ms1_1._patient_id, ms1_1.planned_date_closing_case, ms1_1.gestational_age, ms1_1.onko_stage, ms1_1.hsp_bed_profile_id, ms1_1.is_first_step
  • Index Cond: (ms1_1.case_id = mc.id)
  • Buffers: shared hit=4
290. 0.002 0.060 ↑ 1.0 1 1

Nested Loop (cost=1.00..290.57 rows=1 width=4) (actual time=0.060..0.060 rows=1 loops=1)

  • Output: mdpr_1.id
  • Buffers: shared hit=14
291. 0.020 0.020 ↑ 16.5 2 1

Index Scan using mc_diagnosis_case_id_idx on public.mc_diagnosis mdpr_1 (cost=0.56..11.06 rows=33 width=12) (actual time=0.017..0.020 rows=2 loops=1)

  • Output: mdpr_1.id, mdpr_1.diagnos_id, mdpr_1.step_id
  • Index Cond: (mdpr_1.case_id = mc.id)
  • Filter: mdpr_1.is_main
  • Buffers: shared hit=6
292. 0.038 0.038 ↓ 0.0 0 2

Index Scan using mc_step_pk on public.mc_step mspr (cost=0.44..8.46 rows=1 width=4) (actual time=0.019..0.019 rows=0 loops=2)

  • Output: mspr.id, mspr.admission_date, mspr.admission_time, mspr.death_date, mspr.death_time, mspr.outcome_date, mspr.outcome_time, mspr.death_employee_id, mspr.main_diagnosis_id, mspr.case_id, mspr.outcome_id, mspr.outcome_clinic_id, mspr.outcome_regimen_id, mspr.regimen_id, mspr.res_group_id, mspr.result_id, mspr.reason_id, mspr.profile_id, mspr.mes_id, mspr.mes_quality_criterion_id, mspr.is_continue, mspr.is_continue_editable, mspr.standard_id, mspr.csg_id, mspr.vmp_type_id, mspr.vmp_method_id, mspr.deviation_reason_id, mspr.aud_who, mspr.aud_when, mspr.aud_source, mspr.aud_who_create, mspr.aud_when_create, mspr.aud_source_create, mspr._clinic_id, mspr._patient_id, mspr.planned_date_closing_case, mspr.gestational_age, mspr.onko_stage, mspr.hsp_bed_profile_id, mspr.is_first_step
  • Index Cond: (mspr.id = mdpr_1.step_id)
  • Filter: ((mspr.admission_date + mspr.admission_time) = $48)
  • Buffers: shared hit=8
293. 0.011 0.024 ↑ 1.0 1 1

Nested Loop (cost=1,422.18..1,430.22 rows=1 width=117) (actual time=0.023..0.024 rows=1 loops=1)

  • Output: row_to_json(ROW(sr_service.id, sr_service.name))
  • Buffers: shared hit=4
294. 0.005 0.006 ↑ 1.0 1 1

HashAggregate (cost=1,421.76..1,421.77 rows=1 width=4) (actual time=0.006..0.006 rows=1 loops=1)

  • Output: (CASE WHEN (ssrss.id IS NULL) THEN CASE WHEN (ma.service_id IS NULL) THEN CASE WHEN ($50 > 1) THEN NULL::integer ELSE CASE WHEN ($52 > 1) THEN NULL::integer ELSE $54 END END ELSE ma.service_id END ELSE ssrss.id END)
  • Group Key: CASE WHEN (ssrss.id IS NULL) THEN CASE WHEN (ma.service_id IS NULL) THEN CASE WHEN ($50 > 1) THEN NULL::integer ELSE CASE WHEN ($52 > 1) THEN NULL::integer ELSE $54 END END ELSE ma.service_id END ELSE ssrss.id END
295. 0.001 0.001 ↑ 1.0 1 1

Result (cost=1,421.73..1,421.75 rows=1 width=0) (actual time=0.001..0.001 rows=1 loops=1)

  • Output: CASE WHEN (ssrss.id IS NULL) THEN CASE WHEN (ma.service_id IS NULL) THEN CASE WHEN ($50 > 1) THEN NULL::integer ELSE CASE WHEN ($52 > 1) THEN NULL::integer ELSE $54 END END ELSE ma.service_id END ELSE ssrss.id END
296.          

Initplan (for Result)

297. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=453.09..453.10 rows=1 width=0) (never executed)

  • Output: count(*)
298. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on public.sr_res_group srg_6 (cost=445.07..453.09 rows=2 width=0) (never executed)

  • Output: srg_6.id, srg_6.bdate, srg_6.edate, srg_6.is_system, srg_6.name, srg_6.department_id, srg_6.org_id, srg_6.responsible_id, srg_6.is_available_in_electronic_queue, srg_6.label_id, srg_6.ignore_regclinic_check, srg_6.note, srg_6.blocked, srg_6.block_comment, srg_6.template_res_group_id, srg_6.aud_who, srg_6.aud_when, srg_6.aud_source, srg_6.aud_who_create, srg_6.aud_when_create, srg_6.aud_source_create, srg_6.emergency, srg_6.ignore_districts, srg_6.service_template_id
  • Recheck Cond: ((NOT srg_6.is_system) AND (srg_6.responsible_id = 78020))
299. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=445.07..445.07 rows=2 width=0) (never executed)

300. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_id_is_system_ix (cost=0.00..190.69 rows=11,681 width=0) (never executed)

301. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_responsible_id_id_ix (cost=0.00..254.13 rows=13,008 width=0) (never executed)

  • Index Cond: (srg_6.responsible_id = 78020)
302. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=484.31..484.32 rows=1 width=96) (never executed)

  • Output: count(srgs.*)
303.          

Initplan (for Aggregate)

304. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on public.sr_res_group srg_7 (cost=445.07..453.09 rows=2 width=4) (never executed)

  • Output: srg_7.id
  • Recheck Cond: ((NOT srg_7.is_system) AND (srg_7.responsible_id = 78020))
305. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=445.07..445.07 rows=2 width=0) (never executed)

306. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_id_is_system_ix (cost=0.00..190.69 rows=11,681 width=0) (never executed)

307. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_responsible_id_id_ix (cost=0.00..254.13 rows=13,008 width=0) (never executed)

  • Index Cond: (srg_7.responsible_id = 78020)
308. 0.000 0.000 ↓ 0.0 0

Index Scan using sr_res_group_service_group_id_idx on public.sr_res_group_service srgs (cost=0.43..31.22 rows=2 width=96) (never executed)

  • Output: srgs.*
  • Index Cond: (srgs.group_id = $51)
  • Filter: srgs.default_service
309. 0.000 0.000 ↓ 0.0 0

Index Scan using sr_res_group_service_group_id_idx on public.sr_res_group_service srgs_1 (cost=453.52..484.31 rows=2 width=4) (never executed)

  • Output: srgs_1.srv_type_id
  • Index Cond: (srgs_1.group_id = $53)
  • Filter: srgs_1.default_service
310.          

Initplan (for Index Scan)

311. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on public.sr_res_group srg_8 (cost=445.07..453.09 rows=2 width=4) (never executed)

  • Output: srg_8.id
  • Recheck Cond: ((NOT srg_8.is_system) AND (srg_8.responsible_id = 78020))
312. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=445.07..445.07 rows=2 width=0) (never executed)

313. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_id_is_system_ix (cost=0.00..190.69 rows=11,681 width=0) (never executed)

314. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_responsible_id_id_ix (cost=0.00..254.13 rows=13,008 width=0) (never executed)

  • Index Cond: (srg_8.responsible_id = 78020)
315. 0.007 0.007 ↑ 1.0 1 1

Index Scan using sr_service_pk on public.sr_service (cost=0.42..8.44 rows=1 width=117) (actual time=0.007..0.007 rows=1 loops=1)

  • Output: sr_service.id, sr_service.code, sr_service.cul, sr_service.is_death, sr_service.duration, sr_service.is_fictitious, sr_service.is_independent, sr_service.is_multuplicity, sr_service.name, sr_service.terms, sr_service.org_id, sr_service.category_id, sr_service.duration_unit_id, sr_service.prototype_id, sr_service.type_id, sr_service.from_dt, sr_service.to_dt, sr_service.is_repeated, sr_service.is_inherit_protocol, sr_service.is_expendable_materials, sr_service.is_actual_cul, sr_service.is_paraclinical, sr_service.is_complex, sr_service.accounting_id, sr_service.is_fact, sr_service.is_autocopy_diagnoses, sr_service.is_stomat, sr_service.srg_dif_type_id, sr_service.srg_opr_kind_id, sr_service.is_need_anatomic_zone, sr_service.aud_who, sr_service.aud_when, sr_service.aud_source, sr_service.aud_who_create, sr_service.aud_when_create, sr_service.aud_source_create, sr_service.is_filling, sr_service.is_extraction, sr_service.is_need_close_date, sr_service.is_vmp, sr_service.short_name
  • Index Cond: (sr_service.id = (CASE WHEN (ssrss.id IS NULL) THEN CASE WHEN (ma.service_id IS NULL) THEN CASE WHEN ($50 > 1) THEN NULL::integer ELSE CASE WHEN ($52 > 1) THEN NULL::integer ELSE $54 END END ELSE ma.service_id END ELSE ssrss.id END))
  • Buffers: shared hit=4
316. 0.037 443.456 ↑ 1.0 1 1

Result (cost=243.55..243.56 rows=1 width=0) (actual time=443.455..443.456 rows=1 loops=1)

  • Output: CASE WHEN (NOT $62) THEN ssr.service_id ELSE $65 END
  • Buffers: shared hit=208745
317.          

CTE services_pairs

318. 0.075 0.075 ↑ 1.0 1 1

Index Scan using sr_service_pk on public.sr_service sr_service_1 (cost=0.42..8.58 rows=1 width=124) (actual time=0.072..0.075 rows=1 loops=1)

  • Output: CASE WHEN ("position"((sr_service_1.name)::text, 'овторн'::text) <> 0) THEN sr_service_1.code WHEN ((sr_service_1.code)::text ~ '^(?:[a-zA-Zа-яА-Я]?[0-9]+[.]{1}[0-9]+[.]{1}[0-9]+)$'::text) THEN (concat(split_part((sr_service_1.code)::text, '.'::text, 1), '.', split_part((sr_service_1.code)::text, '.'::text, 2), '.', lpad(((((split_part((sr_service_1.code)::text, '.'::text, 3))::bigint + 1))::character varying)::text, length(split_part((sr_service_1.code)::text, '.'::text, 3)), '0'::text)))::character varying WHEN (((sr_service_1.code)::text ~ '^(?:[a-zA-Zа-яА-Я]?[0-9]+)$'::text) AND (length((concat(regexp_replace((sr_service_1.code)::text, '[^a-zA-Zа-яА-Я]'::text, ''::text, 'g'::text), ((regexp_replace((sr_service_1.code)::text, '[^0-9]'::text, ''::text, 'g'::text))::bigint + 1)))::text) = length((sr_service_1.code)::text))) THEN (concat(regexp_replace((sr_service_1.code)::text, '[^a-zA-Zа-яА-Я]'::text, ''::text, 'g'::text), ((regexp_replace((sr_service_1.code)::text, '[^0-9]'::text, ''::text, 'g'::text))::bigint + 1)))::character varying WHEN (((sr_service_1.code)::text ~ '^(?:[a-zA-Zа-яА-Я]?[0-9]+)$'::text) AND (length((concat(regexp_replace((sr_service_1.code)::text, '[^a-zA-Zа-яА-Я]'::text, ''::text, 'g'::text), ((regexp_replace((sr_service_1.code)::text, '[^0-9]'::text, ''::text, 'g'::text))::bigint + 1)))::text) <> length((sr_service_1.code)::text))) THEN (concat(regexp_replace((sr_service_1.code)::text, '[^a-zA-Zа-яА-Я]'::text, ''::text, 'g'::text), lpad(((((regexp_replace((sr_service_1.code)::text, '[^0-9]'::text, ''::text, 'g'::text))::bigint + 1))::character varying)::text, (length((sr_service_1.code)::text) - length(regexp_replace((sr_service_1.code)::text, '[^a-zA-Zа-яА-Я]'::text, ''::text, 'g'::text))), '0'::text)))::character varying ELSE NULL::character varying END, CASE WHEN ("position"((sr_service_1.name)::text, 'ервичн'::text) <> 0) THEN regexp_replace((sr_service_1.name)::text, 'ервичн'::text, 'овторн'::text) ELSE NULL::text END
  • Index Cond: (sr_service_1.id = ssrss.id)
  • Buffers: shared hit=4
319.          

Initplan (for Result)

320. 0.220 212.113 ↑ 2,086.0 1 1

Nested Loop Semi Join (cost=1.00..216,595.70 rows=2,086 width=0) (actual time=212.113..212.113 rows=1 loops=1)

  • Buffers: shared hit=97488
321. 6.516 130.465 ↑ 1.4 20,357 1

Nested Loop (cost=0.43..186,974.89 rows=29,174 width=4) (actual time=23.712..130.465 rows=20,357 loops=1)

  • Output: sr.group_id
  • Buffers: shared hit=16036
322. 85.283 92.323 ↑ 311.0 14 1

Nested Loop (cost=0.00..28,672.36 rows=4,354 width=4) (actual time=23.672..92.323 rows=14 loops=1)

  • Output: s.id
  • Join Filter: ((btrim((s.code)::text) = btrim((sp.second_service_code)::text)) OR (btrim((s.name)::text) = btrim(sp.second_service_name)))
  • Rows Removed by Join Filter: 35975
  • Buffers: shared hit=1157
323. 0.075 0.075 ↑ 1.0 1 1

CTE Scan on services_pairs sp (cost=0.00..0.02 rows=1 width=64) (actual time=0.075..0.075 rows=1 loops=1)

  • Output: sp.second_service_code, sp.second_service_name
  • Buffers: shared hit=4
324. 6.965 6.965 ↑ 12.1 35,989 1

Seq Scan on public.sr_service s (cost=0.00..17,760.67 rows=436,467 width=128) (actual time=0.005..6.965 rows=35,989 loops=1)

  • Output: s.id, s.code, s.cul, s.is_death, s.duration, s.is_fictitious, s.is_independent, s.is_multuplicity, s.name, s.terms, s.org_id, s.category_id, s.duration_unit_id, s.prototype_id, s.type_id, s.from_dt, s.to_dt, s.is_repeated, s.is_inherit_protocol, s.is_expendable_materials, s.is_actual_cul, s.is_paraclinical, s.is_complex, s.accounting_id, s.is_fact, s.is_autocopy_diagnoses, s.is_stomat, s.srg_dif_type_id, s.srg_opr_kind_id, s.is_need_anatomic_zone, s.aud_who, s.aud_when, s.aud_source, s.aud_who_create, s.aud_when_create, s.aud_source_create, s.is_filling, s.is_extraction, s.is_need_close_date, s.is_vmp, s.short_name
  • Buffers: shared hit=1153
325. 31.626 31.626 ↓ 1.1 1,454 14

Index Scan using sr_res_group_service_srv_type_id_idx on public.sr_res_group_service sr (cost=0.43..23.48 rows=1,288 width=8) (actual time=0.020..2.259 rows=1,454 loops=14)

  • Output: sr.id, sr.bdatetime, sr.edatetime, sr.power, sr.group_id, sr.srv_type_id, sr.moderation_required, sr.patient_multiple_appointment_per_day, sr.referral_required, sr.default_service, sr.aud_who, sr.aud_when, sr.aud_source, sr.aud_who_create, sr.aud_when_create, sr.aud_source_create
  • Index Cond: (sr.srv_type_id = s.id)
  • Buffers: shared hit=14879
326. 81.428 81.428 ↓ 0.0 0 20,357

Index Only Scan using sr_res_group_responsible_id_id_ix on public.sr_res_group rg (cost=0.57..1.01 rows=1 width=4) (actual time=0.004..0.004 rows=0 loops=20,357)

  • Output: rg.responsible_id, rg.id
  • Index Cond: ((rg.responsible_id = 78020) AND (rg.id = sr.group_id))
  • Heap Fetches: 1
  • Buffers: shared hit=81452
327. 0.004 231.306 ↑ 1.0 1 1

Limit (cost=1.42..130.14 rows=1 width=4) (actual time=231.305..231.306 rows=1 loops=1)

  • Output: s_1.id
  • Buffers: shared hit=111257
328. 15.182 231.302 ↑ 2,086.0 1 1

Nested Loop Semi Join (cost=1.42..268,515.85 rows=2,086 width=4) (actual time=231.302..231.302 rows=1 loops=1)

  • Output: s_1.id
  • Buffers: shared hit=111257
329. 4.770 174.798 ↑ 1.4 20,661 1

Nested Loop (cost=0.85..238,895.03 rows=29,174 width=8) (actual time=30.174..174.798 rows=20,661 loops=1)

  • Output: s_1.id, sr_1.group_id
  • Buffers: shared hit=28593
330. 111.894 140.284 ↑ 544.2 8 1

Nested Loop (cost=0.42..80,592.51 rows=4,354 width=4) (actual time=30.140..140.284 rows=8 loops=1)

  • Output: s_1.id
  • Join Filter: ((btrim((s_1.code)::text) = btrim((sp_1.second_service_code)::text)) OR (btrim((s_1.name)::text) = btrim(sp_1.second_service_name)))
  • Rows Removed by Join Filter: 44853
  • Buffers: shared hit=11532
331. 28.390 28.390 ↑ 9.7 44,861 1

Index Scan Backward using sr_service_pk on public.sr_service s_1 (cost=0.42..65,316.16 rows=436,467 width=128) (actual time=0.016..28.390 rows=44,861 loops=1)

  • Output: s_1.id, s_1.code, s_1.cul, s_1.is_death, s_1.duration, s_1.is_fictitious, s_1.is_independent, s_1.is_multuplicity, s_1.name, s_1.terms, s_1.org_id, s_1.category_id, s_1.duration_unit_id, s_1.prototype_id, s_1.type_id, s_1.from_dt, s_1.to_dt, s_1.is_repeated, s_1.is_inherit_protocol, s_1.is_expendable_materials, s_1.is_actual_cul, s_1.is_paraclinical, s_1.is_complex, s_1.accounting_id, s_1.is_fact, s_1.is_autocopy_diagnoses, s_1.is_stomat, s_1.srg_dif_type_id, s_1.srg_opr_kind_id, s_1.is_need_anatomic_zone, 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.is_filling, s_1.is_extraction, s_1.is_need_close_date, s_1.is_vmp, s_1.short_name
  • Buffers: shared hit=11532
332. 0.000 0.000 ↑ 1.0 1 44,861

CTE Scan on services_pairs sp_1 (cost=0.00..0.02 rows=1 width=64) (actual time=0.000..0.000 rows=1 loops=44,861)

  • Output: sp_1.second_service_code, sp_1.second_service_name
333. 29.744 29.744 ↓ 2.0 2,583 8

Index Scan using sr_res_group_service_srv_type_id_idx on public.sr_res_group_service sr_1 (cost=0.43..23.48 rows=1,288 width=8) (actual time=0.026..3.718 rows=2,583 loops=8)

  • Output: sr_1.id, sr_1.bdatetime, sr_1.edatetime, sr_1.power, sr_1.group_id, sr_1.srv_type_id, sr_1.moderation_required, sr_1.patient_multiple_appointment_per_day, sr_1.referral_required, sr_1.default_service, sr_1.aud_who, sr_1.aud_when, sr_1.aud_source, sr_1.aud_who_create, sr_1.aud_when_create, sr_1.aud_source_create
  • Index Cond: (sr_1.srv_type_id = s_1.id)
  • Buffers: shared hit=17061
334. 41.322 41.322 ↓ 0.0 0 20,661

Index Only Scan using sr_res_group_responsible_id_id_ix on public.sr_res_group rg_1 (cost=0.57..1.01 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=20,661)

  • Output: rg_1.responsible_id, rg_1.id
  • Index Cond: ((rg_1.responsible_id = 78020) AND (rg_1.id = sr_1.group_id))
  • Heap Fetches: 1
  • Buffers: shared hit=82664
335. 0.081 0.081 ↑ 1.0 1 1

Index Scan using pim_individual_pk on public.pim_individual (cost=0.43..8.46 rows=1 width=4) (actual time=0.080..0.081 rows=1 loops=1)

  • Output: ('3 years'::interval >= age((ssr.bdate)::timestamp with time zone, (pim_individual.birth_dt)::timestamp with time zone))
  • Index Cond: (pim_individual.id = ssr.customer_id)
  • Buffers: shared hit=4
336. 0.020 0.193 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.85..144.92 rows=1 width=522) (actual time=0.193..0.193 rows=0 loops=1)

  • Output: row_to_json(ROW(mr.id, to_char(mr.referral_date, 'dd.mm.yyyy 00:00'::text), mr.is_urgent, mr.order_number, ((((((COALESCE(((mrt.name)::text || ', '::text), ''::text) || ' '::text) || COALESCE(((mr.order_number)::text || ', '::text), ''::text)) || ' '::text) || to_char(mr.referral_date, 'dd.mm.yyyy'::text)) || ', '::text) || (COALESCE(po.full_name, ''::character varying))::text), mr.patient_id, CASE WHEN ((mrds.code)::text = '4'::text) THEN false ELSE true END, recv_org.id, CASE WHEN (mr.ref_organization_role_id IS NOT NULL) THEN mr.ref_organization_role_id ELSE CASE WHEN ((SubPlan 43) = 1) THEN (SubPlan 44) ELSE NULL::integer END END, CASE WHEN (mr.ref_organization_role_id IS NOT NULL) THEN pr.name ELSE CASE WHEN ((SubPlan 45) = 1) THEN (SubPlan 46) ELSE NULL::character varying END END, ref_org_1.id, COALESCE(ref_org_1.short_name, ref_org_1.full_name), ref_dep_1.id, ref_dep_1.name, mr.ref_doctor_id, (SubPlan 48), md_1.id, (((md_1.code)::text || ' '::text) || (md_1.name)::text), mr.order_number, mr.diagnosis_comment, mr.referral_type_id))
  • Join Filter: (pr.id = mr.ref_organization_role_id)
337. 0.020 0.173 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.85..53.79 rows=1 width=509) (actual time=0.173..0.173 rows=0 loops=1)

  • Output: mr.id, mr.referral_date, mr.is_urgent, mr.order_number, mr.patient_id, mr.ref_organization_role_id, mr.ref_organization_id, mr.ref_doctor_id, mr.diagnosis_comment, mr.referral_type_id, mrds.code, po.full_name, mrt.name, ref_org_1.id, ref_org_1.short_name, ref_org_1.full_name, recv_org.id, ref_dep_1.id, ref_dep_1.name, md_1.id, md_1.code, md_1.name
338. 0.033 0.153 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.57..45.48 rows=1 width=387) (actual time=0.153..0.153 rows=0 loops=1)

  • Output: mr.id, mr.referral_date, mr.is_urgent, mr.order_number, mr.patient_id, mr.ref_organization_role_id, mr.ref_organization_id, mr.ref_doctor_id, mr.diagnosis_comment, mr.referral_type_id, mr.diagnosis_id, mrds.code, po.full_name, mrt.name, ref_org_1.id, ref_org_1.short_name, ref_org_1.full_name, recv_org.id, ref_dep_1.id, ref_dep_1.name
339. 0.018 0.120 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.29..37.17 rows=1 width=329) (actual time=0.120..0.120 rows=0 loops=1)

  • Output: mr.id, mr.referral_date, mr.is_urgent, mr.order_number, mr.patient_id, mr.ref_organization_role_id, mr.ref_organization_id, mr.ref_doctor_id, mr.diagnosis_comment, mr.referral_type_id, mr.ref_department_id, mr.diagnosis_id, mrds.code, po.full_name, mrt.name, ref_org_1.id, ref_org_1.short_name, ref_org_1.full_name, recv_org.id
340. 0.019 0.102 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.00..28.86 rows=1 width=329) (actual time=0.102..0.102 rows=0 loops=1)

  • Output: mr.id, mr.referral_date, mr.is_urgent, mr.order_number, mr.patient_id, mr.ref_organization_role_id, mr.ref_organization_id, mr.ref_doctor_id, mr.diagnosis_comment, mr.referral_type_id, mr.recv_organization_id, mr.ref_department_id, mr.diagnosis_id, mrds.code, po.full_name, mrt.name, ref_org_1.id, ref_org_1.short_name, ref_org_1.full_name
  • Join Filter: (mr.referral_type_id = mrt.id)
341. 0.014 0.083 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.00..26.19 rows=1 width=264) (actual time=0.083..0.083 rows=0 loops=1)

  • Output: mr.id, mr.referral_date, mr.is_urgent, mr.order_number, mr.patient_id, mr.ref_organization_role_id, mr.ref_organization_id, mr.ref_doctor_id, mr.diagnosis_comment, mr.referral_type_id, mr.recv_organization_id, mr.ref_department_id, mr.diagnosis_id, mrds.code, po.full_name, ref_org_1.id, ref_org_1.short_name, ref_org_1.full_name
342. 0.029 0.069 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.72..17.87 rows=1 width=149) (actual time=0.069..0.069 rows=0 loops=1)

  • Output: mr.id, mr.referral_date, mr.is_urgent, mr.order_number, mr.patient_id, mr.ref_organization_role_id, mr.ref_organization_id, mr.ref_doctor_id, mr.diagnosis_comment, mr.referral_type_id, mr.recv_organization_id, mr.ref_department_id, mr.diagnosis_id, mrds.code, po.full_name
343. 0.031 0.040 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.43..9.56 rows=1 width=87) (actual time=0.040..0.040 rows=0 loops=1)

  • Output: mr.id, mr.referral_date, mr.is_urgent, mr.order_number, mr.patient_id, mr.ref_organization_role_id, mr.ref_organization_id, mr.ref_doctor_id, mr.diagnosis_comment, mr.referral_type_id, mr.recv_organization_id, mr.ref_department_id, mr.diagnosis_id, mrds.code
  • Join Filter: (mr.status_id = mrds.id)
344. 0.009 0.009 ↓ 0.0 0 1

Index Scan using md_referral_pk on public.md_referral mr (cost=0.43..8.45 rows=1 width=89) (actual time=0.009..0.009 rows=0 loops=1)

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

Seq Scan on public.md_ref_document_status mrds (cost=0.00..1.05 rows=5 width=6) (never executed)

  • Output: mrds.id, mrds.code, mrds.name, mrds.aud_who, mrds.aud_when, mrds.aud_source, mrds.aud_who_create, mrds.aud_when_create, mrds.aud_source_create
346. 0.000 0.000 ↓ 0.0 0

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

  • Output: po.full_name, po.id
  • Index Cond: (mr.ref_organization_id = po.id)
347. 0.000 0.000 ↓ 0.0 0

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

  • Output: ref_org_1.id, ref_org_1.short_name, ref_org_1.full_name
  • Index Cond: (mr.ref_organization_id = ref_org_1.id)
348. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.md_referral_type mrt (cost=0.00..2.30 rows=30 width=69) (never executed)

  • Output: mrt.id, mrt.code, mrt.name, mrt.scope_id, mrt.e_code, mrt.hsp_rsv_mark, mrt.aud_who, mrt.aud_when, mrt.aud_source, mrt.aud_who_create, mrt.aud_when_create, mrt.aud_source_create, mrt.from_dt, mrt.to_dt, mrt.app_code, mrt.is_laboratory, mrt.is_vk, mrt.billing_code
349. 0.000 0.000 ↓ 0.0 0

Index Only Scan using pim_organization_pk on public.pim_organization recv_org (cost=0.29..8.30 rows=1 width=4) (never executed)

  • Output: recv_org.id
  • Index Cond: (recv_org.id = mr.recv_organization_id)
  • Heap Fetches: 0
350. 0.000 0.000 ↓ 0.0 0

Index Scan using pim_department_pk on public.pim_department ref_dep_1 (cost=0.28..8.30 rows=1 width=62) (never executed)

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

Index Scan using md_diagnosis_pk on public.md_diagnosis md_1 (cost=0.29..8.30 rows=1 width=126) (never executed)

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

Seq Scan on public.pim_party_role pr (cost=0.00..1.24 rows=24 width=17) (never executed)

  • Output: pr.id, pr.name, pr.note, pr.code, pr.type_id, pr.aud_who, pr.aud_when, pr.aud_source, pr.aud_who_create, pr.aud_when_create, pr.aud_source_create
353.          

SubPlan (for Nested Loop Left Join)

354. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=8.44..8.45 rows=1 width=96) (never executed)

  • Output: count(rtp.*)
355. 0.000 0.000 ↓ 0.0 0

Index Scan using pim_party_role_to_party_party_id_idx on public.pim_party_role_to_party rtp (cost=0.42..8.44 rows=1 width=96) (never executed)

  • Output: rtp.*
  • Index Cond: (rtp.party_id = mr.ref_organization_id)
356. 0.000 0.000 ↓ 0.0 0

Index Scan using pim_party_role_to_party_party_id_idx on public.pim_party_role_to_party (cost=0.42..8.44 rows=1 width=4) (never executed)

  • Output: pim_party_role_to_party.role_id
  • Index Cond: (pim_party_role_to_party.party_id = mr.ref_organization_id)
357. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=8.44..8.45 rows=1 width=96) (never executed)

  • Output: count(rtp_1.*)
358. 0.000 0.000 ↓ 0.0 0

Index Scan using pim_party_role_to_party_party_id_idx on public.pim_party_role_to_party rtp_1 (cost=0.42..8.44 rows=1 width=96) (never executed)

  • Output: rtp_1.*
  • Index Cond: (rtp_1.party_id = mr.ref_organization_id)
359. 0.000 0.000 ↓ 0.0 0

Hash Semi Join (cost=8.45..9.77 rows=1 width=13) (never executed)

  • Output: pim_party_role.name
  • Hash Cond: (pim_party_role.id = pim_party_role_to_party_1.role_id)
360. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.pim_party_role (cost=0.00..1.24 rows=24 width=17) (never executed)

  • Output: pim_party_role.id, pim_party_role.name, pim_party_role.note, pim_party_role.code, pim_party_role.type_id, pim_party_role.aud_who, pim_party_role.aud_when, pim_party_role.aud_source, pim_party_role.aud_who_create, pim_party_role.aud_when_create, pim_party_role.aud_source_create
361. 0.000 0.000 ↓ 0.0 0

Hash (cost=8.44..8.44 rows=1 width=4) (never executed)

  • Output: pim_party_role_to_party_1.role_id
362. 0.000 0.000 ↓ 0.0 0

Index Only Scan using pim_org_role_to_org_pk on public.pim_party_role_to_party pim_party_role_to_party_1 (cost=0.42..8.44 rows=1 width=4) (never executed)

  • Output: pim_party_role_to_party_1.role_id
  • Index Cond: (pim_party_role_to_party_1.party_id = mr.ref_organization_id)
  • Heap Fetches: 0
363. 0.000 0.000 ↓ 0.0 0

Limit (cost=2.16..54.44 rows=1 width=161) (never executed)

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

Nested Loop (cost=2.16..54.44 rows=1 width=161) (never executed)

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

Nested Loop (cost=1.88..45.77 rows=1 width=107) (never executed)

  • Output: pim_individual_1.surname, pim_individual_1.name, pim_individual_1.patr_name, pos.name, pos.speciality_id, pos.department_id
366. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.59..37.45 rows=1 width=53) (never executed)

  • Output: pim_employee_position.position_id, pim_individual_1.surname, pim_individual_1.name, pim_individual_1.patr_name
367. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.16..33.26 rows=1 width=8) (never executed)

  • Output: pim_employee_position.position_id, pim_employee.individual_id
368. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.87..24.94 rows=1 width=8) (never executed)

  • Output: pim_employee_position.employee_id, pim_employee_position.position_id
369. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.58..16.62 rows=1 width=12) (never executed)

  • Output: pim_employee_position.id, pim_employee_position.employee_id, pim_employee_position.position_id
370. 0.000 0.000 ↓ 0.0 0

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

  • Output: md_employee_position.id
  • Index Cond: (md_employee_position.id = mr.ref_doctor_id)
  • Heap Fetches: 0
371. 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 = mr.ref_doctor_id)
372. 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 = mr.ref_doctor_id)
  • Heap Fetches: 0
373. 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)
374. 0.000 0.000 ↓ 0.0 0

Index Scan using pim_individual_pk on public.pim_individual pim_individual_1 (cost=0.43..4.18 rows=1 width=53) (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, pim_individual_1.is_only_birth_year
  • Index Cond: (pim_individual_1.id = pim_employee.individual_id)
375. 0.000 0.000 ↓ 0.0 0

Index Scan using pim_position_pk on public.pim_position pos (cost=0.29..8.30 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, pos.note, pos.fact_employment, pos.external_rate, pos.billing_code
  • Index Cond: (pos.id = pim_employee_position.position_id)
376. 0.000 0.000 ↓ 0.0 0

Index Scan using pim_department_pk on public.pim_department dep (cost=0.28..0.33 rows=1 width=62) (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.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, dep.cadastral_number, dep.hospital_mode_id, dep.type_profile_id
  • Index Cond: (dep.id = pos.department_id)
377.          

SubPlan (for Nested Loop)

378. 0.000 0.000 ↓ 0.0 0

Index Scan using pim_speciality_pk on public.pim_speciality (cost=0.27..8.29 rows=1 width=38) (never executed)

  • Output: pim_speciality.name
  • Index Cond: (pim_speciality.id = pos.speciality_id)
379. 0.032 0.137 ↓ 0.0 0 1

Limit (cost=2.16..54.44 rows=1 width=161) (actual time=0.137..0.137 rows=0 loops=1)

  • Output: ((((((((((COALESCE(pim_individual_2.surname, ''::character varying))::text || ' '::text) || CASE COALESCE("substring"((pim_individual_2.name)::text, 1, 1), ''::text) WHEN ''::text THEN ''::text ELSE ("substring"((pim_individual_2.name)::text, 1, 1) || '.'::text) END) || ' '::text) || CASE COALESCE("substring"((pim_individual_2.patr_name)::text, 1, 1), ''::text) WHEN ''::text THEN ''::text ELSE ("substring"((pim_individual_2.patr_name)::text, 1, 1) || '.'::text) END) || ', '::text) || (COALESCE(pos_1.name, (SubPlan 51)))::text) || ', '::text) || (dep_1.name)::text))
380. 0.010 0.105 ↓ 0.0 0 1

Nested Loop (cost=2.16..54.44 rows=1 width=161) (actual time=0.105..0.105 rows=0 loops=1)

  • Output: (((((((((COALESCE(pim_individual_2.surname, ''::character varying))::text || ' '::text) || CASE COALESCE("substring"((pim_individual_2.name)::text, 1, 1), ''::text) WHEN ''::text THEN ''::text ELSE ("substring"((pim_individual_2.name)::text, 1, 1) || '.'::text) END) || ' '::text) || CASE COALESCE("substring"((pim_individual_2.patr_name)::text, 1, 1), ''::text) WHEN ''::text THEN ''::text ELSE ("substring"((pim_individual_2.patr_name)::text, 1, 1) || '.'::text) END) || ', '::text) || (COALESCE(pos_1.name, (SubPlan 51)))::text) || ', '::text) || (dep_1.name)::text)
381. 0.011 0.095 ↓ 0.0 0 1

Nested Loop (cost=1.88..45.77 rows=1 width=107) (actual time=0.095..0.095 rows=0 loops=1)

  • Output: pim_individual_2.surname, pim_individual_2.name, pim_individual_2.patr_name, pos_1.name, pos_1.speciality_id, pos_1.department_id
382. 0.010 0.084 ↓ 0.0 0 1

Nested Loop (cost=1.59..37.45 rows=1 width=53) (actual time=0.084..0.084 rows=0 loops=1)

  • Output: pim_employee_position_1.position_id, pim_individual_2.surname, pim_individual_2.name, pim_individual_2.patr_name
383. 0.015 0.074 ↓ 0.0 0 1

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

  • Output: pim_employee_position_1.position_id, pim_employee_1.individual_id
384. 0.027 0.059 ↓ 0.0 0 1

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

  • Output: pim_employee_position_1.employee_id, pim_employee_position_1.position_id
385. 0.030 0.032 ↓ 0.0 0 1

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

  • Output: pim_employee_position_1.id, pim_employee_position_1.employee_id, pim_employee_position_1.position_id
386. 0.002 0.002 ↓ 0.0 0 1

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

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

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

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

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

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

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

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

Index Scan using pim_individual_pk on public.pim_individual pim_individual_2 (cost=0.43..4.18 rows=1 width=53) (never executed)

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

Index Scan using pim_position_pk on public.pim_position pos_1 (cost=0.29..8.30 rows=1 width=62) (never executed)

  • Output: pos_1.id, pos_1.code, pos_1.start_date, pos_1.name, pos_1.end_date, pos_1.department_id, pos_1.organization_id, pos_1.role_id, pos_1.speciality_id, pos_1.rate, pos_1.aud_who, pos_1.aud_when, pos_1.aud_source, pos_1.aud_who_create, pos_1.aud_when_create, pos_1.aud_source_create, pos_1.pref_prescription, pos_1.payment_fond, pos_1.staff_event1, pos_1.staff_event2, pos_1.note, pos_1.fact_employment, pos_1.external_rate, pos_1.billing_code
  • Index Cond: (pos_1.id = pim_employee_position_1.position_id)
392. 0.000 0.000 ↓ 0.0 0

Index Scan using pim_department_pk on public.pim_department dep_1 (cost=0.28..0.33 rows=1 width=62) (never executed)

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

SubPlan (for Nested Loop)

394. 0.000 0.000 ↓ 0.0 0

Index Scan using pim_speciality_pk on public.pim_speciality pim_speciality_1 (cost=0.27..8.29 rows=1 width=38) (never executed)

  • Output: pim_speciality_1.name
  • Index Cond: (pim_speciality_1.id = pos_1.speciality_id)
395. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.15..17.25 rows=1 width=4) (never executed)

  • Output: pe1.id
396. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.86..16.90 rows=1 width=4) (never executed)

  • Output: pep.employee_id
397. 0.000 0.000 ↓ 0.0 0

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

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

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

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

Index Only Scan using pim_employee_pk on public.pim_employee pe1 (cost=0.29..0.34 rows=1 width=4) (never executed)

  • Output: pe1.id
  • Index Cond: (pe1.id = pep.employee_id)
  • Heap Fetches: 0
400. 0.101 0.180 ↑ 1.0 1 1

Nested Loop Left Join (cost=1.14..17.18 rows=1 width=1) (actual time=0.178..0.180 rows=1 loops=1)

  • Output: srgg.is_system
  • Buffers: shared hit=10
401. 0.052 0.052 ↑ 1.0 1 1

Index Scan using sr_srv_rendered_pk on public.sr_srv_rendered ssrr (cost=0.57..8.59 rows=1 width=4) (actual time=0.052..0.052 rows=1 loops=1)

  • Output: ssrr.id, ssrr.bdate, ssrr.comment, ssrr.cost, ssrr.duration, ssrr.edate, ssrr.is_rendered, ssrr.quantity, ssrr.total_cost, ssrr.contract_id, ssrr.customer_id, ssrr.funding_id, ssrr.res_group_id, ssrr.service_id, ssrr.duration_measure_unit_id, ssrr.begin_time, ssrr.prototype_id, ssrr.org_id, ssrr.price_list_id, ssrr.cul, ssrr.parent_id, ssrr.payment_status_id, ssrr.root_service_id, ssrr.is_wholly_rendered, ssrr.planned_date, ssrr.planned_time, ssrr.tooth_number, ssrr.is_refused, ssrr.aud_who, ssrr.aud_when, ssrr.aud_source, ssrr.aud_who_create, ssrr.aud_when_create, ssrr.aud_source_create, ssrr.is_amalgam_filling, ssrr.is_mobile_medical_teams, ssrr.close_date, ssrr.complex_srv_id, ssrr.for_upload, ssrr.uid, ssrr.is_need_consulting
  • Index Cond: (ssrr.id = ssr.id)
  • Buffers: shared hit=5
402. 0.027 0.027 ↑ 1.0 1 1

Index Scan using sr_res_group_pk on public.sr_res_group srgg (cost=0.57..8.59 rows=1 width=5) (actual time=0.026..0.027 rows=1 loops=1)

  • Output: srgg.id, srgg.bdate, srgg.edate, srgg.is_system, srgg.name, srgg.department_id, srgg.org_id, srgg.responsible_id, srgg.is_available_in_electronic_queue, srgg.label_id, srgg.ignore_regclinic_check, srgg.note, srgg.blocked, srgg.block_comment, srgg.template_res_group_id, srgg.aud_who, srgg.aud_when, srgg.aud_source, srgg.aud_who_create, srgg.aud_when_create, srgg.aud_source_create, srgg.emergency, srgg.ignore_districts, srgg.service_template_id
  • Index Cond: (ssrr.res_group_id = srgg.id)
  • Buffers: shared hit=5
403. 0.014 0.014 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.014..0.014 rows=1 loops=1)

  • Output: row_to_json(ROW(mpm.id, mpm.name))
404. 0.000 0.181 ↑ 1.0 1 1

Limit (cost=12.65..24.41 rows=1 width=4) (actual time=0.181..0.181 rows=1 loops=1)

  • Output: ms_1.admission_date
  • Buffers: shared hit=8
405.          

Initplan (for Limit)

406. 0.020 0.089 ↑ 1.0 1 1

Limit (cost=12.20..12.21 rows=1 width=12) (actual time=0.089..0.089 rows=1 loops=1)

  • Output: (min((ms1_2.admission_date + ms1_2.admission_time)))
  • Buffers: shared hit=4
407. 0.037 0.069 ↑ 1.0 1 1

Aggregate (cost=12.20..12.21 rows=1 width=12) (actual time=0.069..0.069 rows=1 loops=1)

  • Output: min((ms1_2.admission_date + ms1_2.admission_time))
  • Buffers: shared hit=4
408. 0.032 0.032 ↑ 17.0 1 1

Index Scan using idx_mc_step on public.mc_step ms1_2 (cost=0.44..12.12 rows=17 width=12) (actual time=0.031..0.032 rows=1 loops=1)

  • Output: ms1_2.id, ms1_2.admission_date, ms1_2.admission_time, ms1_2.death_date, ms1_2.death_time, ms1_2.outcome_date, ms1_2.outcome_time, ms1_2.death_employee_id, ms1_2.main_diagnosis_id, ms1_2.case_id, ms1_2.outcome_id, ms1_2.outcome_clinic_id, ms1_2.outcome_regimen_id, ms1_2.regimen_id, ms1_2.res_group_id, ms1_2.result_id, ms1_2.reason_id, ms1_2.profile_id, ms1_2.mes_id, ms1_2.mes_quality_criterion_id, ms1_2.is_continue, ms1_2.is_continue_editable, ms1_2.standard_id, ms1_2.csg_id, ms1_2.vmp_type_id, ms1_2.vmp_method_id, ms1_2.deviation_reason_id, ms1_2.aud_who, ms1_2.aud_when, ms1_2.aud_source, ms1_2.aud_who_create, ms1_2.aud_when_create, ms1_2.aud_source_create, ms1_2._clinic_id, ms1_2._patient_id, ms1_2.planned_date_closing_case, ms1_2.gestational_age, ms1_2.onko_stage, ms1_2.hsp_bed_profile_id, ms1_2.is_first_step
  • Index Cond: (ms1_2.case_id = mc.id)
  • Buffers: shared hit=4
409. 0.155 0.155 ↑ 1.0 1 1

Index Scan using idx_mc_step on public.mc_step ms_1 (cost=0.44..12.20 rows=1 width=4) (actual time=0.155..0.155 rows=1 loops=1)

  • Output: ms_1.admission_date
  • Index Cond: (ms_1.case_id = mc.id)
  • Filter: ((ms_1.admission_date + ms_1.admission_time) = $100)
  • Buffers: shared hit=8
410. 0.014 1.456 ↓ 0.0 0 1

Subquery Scan on l (cost=485.03..485.05 rows=1 width=51) (actual time=1.456..1.456 rows=0 loops=1)

  • Output: row_to_json(l.*)
  • Buffers: shared hit=134
411. 0.008 1.442 ↓ 0.0 0 1

Limit (cost=485.03..485.04 rows=1 width=31) (actual time=1.442..1.442 rows=0 loops=1)

  • Output: pcp.id, pcp.name, ppcp.id
  • Buffers: shared hit=134
412.          

Initplan (for Limit)

413. 0.000 0.000 ↓ 0.0 0

Limit (cost=233.65..233.66 rows=1 width=8) (never executed)

  • Output: (max(ppcp1.date))
414. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=233.65..233.66 rows=1 width=8) (never executed)

  • Output: max(ppcp1.date)
415. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.pci_patient_card_place ppcp1 (cost=0.00..233.64 rows=1 width=8) (never executed)

  • Output: ppcp1.date
  • Filter: ((ppcp1.patient_id = ssr.customer_id) AND (ppcp1.clinic_id = 1805760))
416. 0.044 1.434 ↓ 0.0 0 1

Sort (cost=251.38..251.38 rows=1 width=31) (actual time=1.434..1.434 rows=0 loops=1)

  • Output: pcp.id, pcp.name, ppcp.id
  • Sort Key: ppcp.id DESC
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=134
417. 0.033 1.390 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.00..251.37 rows=1 width=31) (actual time=1.390..1.390 rows=0 loops=1)

  • Output: pcp.id, pcp.name, ppcp.id
  • Join Filter: (ppcp.card_place_id = pcp.id)
  • Buffers: shared hit=134
418. 1.357 1.357 ↓ 0.0 0 1

Seq Scan on public.pci_patient_card_place ppcp (cost=0.00..250.25 rows=1 width=8) (actual time=1.357..1.357 rows=0 loops=1)

  • Output: ppcp.id, ppcp.card_place_id
  • Filter: ((ppcp.patient_id = ssr.customer_id) AND (ppcp.date = $102) AND (ppcp.clinic_id = 1805760))
  • Rows Removed by Filter: 6644
  • Buffers: shared hit=134
419. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.pci_card_place pcp (cost=0.00..1.05 rows=5 width=27) (never executed)

  • Output: pcp.id, pcp.code, pcp.name, pcp.clinic_id, pcp.e_code, pcp.aud_who, pcp.aud_when, pcp.aud_source, pcp.aud_who_create, pcp.aud_when_create, pcp.aud_source_create, pcp.from_dt, pcp.to_dt
420. 0.001 0.817 ↓ 0.0 0 1

Limit (cost=485.03..485.04 rows=1 width=8) (actual time=0.817..0.817 rows=0 loops=1)

  • Output: pcp_1.id, ppcp_1.id
  • Buffers: shared hit=134
421.          

Initplan (for Limit)

422. 0.000 0.000 ↓ 0.0 0

Limit (cost=233.65..233.66 rows=1 width=8) (never executed)

  • Output: (max(ppcp1_1.date))
423. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=233.65..233.66 rows=1 width=8) (never executed)

  • Output: max(ppcp1_1.date)
424. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.pci_patient_card_place ppcp1_1 (cost=0.00..233.64 rows=1 width=8) (never executed)

  • Output: ppcp1_1.date
  • Filter: ((ppcp1_1.patient_id = ssr.customer_id) AND (ppcp1_1.clinic_id = 1805760))
425. 0.036 0.816 ↓ 0.0 0 1

Sort (cost=251.38..251.38 rows=1 width=8) (actual time=0.816..0.816 rows=0 loops=1)

  • Output: pcp_1.id, ppcp_1.id
  • Sort Key: ppcp_1.id DESC
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=134
426. 0.016 0.780 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.00..251.37 rows=1 width=8) (actual time=0.780..0.780 rows=0 loops=1)

  • Output: pcp_1.id, ppcp_1.id
  • Join Filter: (ppcp_1.card_place_id = pcp_1.id)
  • Buffers: shared hit=134
427. 0.764 0.764 ↓ 0.0 0 1

Seq Scan on public.pci_patient_card_place ppcp_1 (cost=0.00..250.25 rows=1 width=8) (actual time=0.764..0.764 rows=0 loops=1)

  • Output: ppcp_1.id, ppcp_1.card_place_id
  • Filter: ((ppcp_1.patient_id = ssr.customer_id) AND (ppcp_1.date = $104) AND (ppcp_1.clinic_id = 1805760))
  • Rows Removed by Filter: 6644
  • Buffers: shared hit=134
428. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.pci_card_place pcp_1 (cost=0.00..1.05 rows=5 width=4) (never executed)

  • Output: pcp_1.id, pcp_1.code, pcp_1.name, pcp_1.clinic_id, pcp_1.e_code, pcp_1.aud_who, pcp_1.aud_when, pcp_1.aud_source, pcp_1.aud_who_create, pcp_1.aud_when_create, pcp_1.aud_source_create, pcp_1.from_dt, pcp_1.to_dt
429. 0.014 0.805 ↓ 0.0 0 1

Limit (cost=483.92..483.92 rows=1 width=8) (actual time=0.805..0.805 rows=0 loops=1)

  • Output: ppcp_2.employee_position_id, ppcp_2.id
  • Buffers: shared hit=134
430.          

Initplan (for Limit)

431. 0.000 0.000 ↓ 0.0 0

Limit (cost=233.65..233.66 rows=1 width=8) (never executed)

  • Output: (max(ppcp1_2.date))
432. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=233.65..233.66 rows=1 width=8) (never executed)

  • Output: max(ppcp1_2.date)
433. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.pci_patient_card_place ppcp1_2 (cost=0.00..233.64 rows=1 width=8) (never executed)

  • Output: ppcp1_2.date
  • Filter: ((ppcp1_2.patient_id = ssr.customer_id) AND (ppcp1_2.clinic_id = 1805760))
434. 0.019 0.791 ↓ 0.0 0 1

Sort (cost=250.26..250.27 rows=1 width=8) (actual time=0.791..0.791 rows=0 loops=1)

  • Output: ppcp_2.employee_position_id, ppcp_2.id
  • Sort Key: ppcp_2.id DESC
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=134
435. 0.772 0.772 ↓ 0.0 0 1

Seq Scan on public.pci_patient_card_place ppcp_2 (cost=0.00..250.25 rows=1 width=8) (actual time=0.772..0.772 rows=0 loops=1)

  • Output: ppcp_2.employee_position_id, ppcp_2.id
  • Filter: ((ppcp_2.patient_id = ssr.customer_id) AND (ppcp_2.date = $106) AND (ppcp_2.clinic_id = 1805760))
  • Rows Removed by Filter: 6644
  • Buffers: shared hit=134
436. 0.023 0.149 ↑ 1.0 1 1

Aggregate (cost=7,770.27..7,770.28 rows=1 width=4) (actual time=0.149..0.149 rows=1 loops=1)

  • Output: count(fbsi.id)
  • Buffers: shared hit=10
437. 0.058 0.126 ↑ 403.0 1 1

Nested Loop (cost=1.00..7,769.26 rows=403 width=4) (actual time=0.122..0.126 rows=1 loops=1)

  • Output: fbsi.id
  • Buffers: shared hit=10
438. 0.035 0.035 ↑ 913.0 1 1

Index Scan using md_srv_rendered_case_id_idx on public.md_srv_rendered msre (cost=0.57..60.71 rows=913 width=4) (actual time=0.035..0.035 rows=1 loops=1)

  • Output: msre.id, msre.is_urgent, msre.is_use_cryogenic, msre.is_use_endoscopic, msre.is_use_laser, msre.anesthesia_type_id, msre.step_id, msre.complication_type_id, msre.diagnosis_id, msre.case_id, msre.referral_id, msre.result_category_id, msre.patient_prescription_id, msre.health_group_id, msre.vmp_type_id, msre.vmp_method_id, msre.anatomic_zone_id, msre.aud_who, msre.aud_when, msre.aud_source, msre.aud_who_create, msre.aud_when_create, msre.aud_source_create, msre.prescription_id, msre.by_standard, msre.complicated_value, msre.vmp_profile_id
  • Index Cond: (msre.case_id = mc.id)
  • Buffers: shared hit=5
439. 0.033 0.033 ↑ 1.0 1 1

Index Scan using fin_bill_spec_item_service_id_idx on public.fin_bill_spec_item fbsi (cost=0.44..8.43 rows=1 width=8) (actual time=0.030..0.033 rows=1 loops=1)

  • Output: fbsi.id, fbsi.price, fbsi.tariff, fbsi.bill_id, fbsi.service_id, fbsi.number, fbsi.is_deleted, fbsi.comment, fbsi.doc_id, fbsi.status_id, fbsi.correctional_bill_id
  • Index Cond: (fbsi.service_id = msre.id)
  • Buffers: shared hit=5
440. 0.079 0.079 ↑ 1.0 1 1

Index Scan using pim_individual_pk on public.pim_individual i_1 (cost=0.43..8.46 rows=1 width=4) (actual time=0.078..0.079 rows=1 loops=1)

  • Output: date_part('year'::text, age((('now'::cstring)::date)::timestamp with time zone, (i_1.birth_dt)::timestamp with time zone))
  • Index Cond: (i_1.id = ssr.customer_id)
  • Buffers: shared hit=4
441. 0.000 0.000 ↓ 0.0 0

Seq Scan on motherhood.mh_pregnant_map pm (cost=0.00..3.38 rows=1 width=0) (never executed)

  • Filter: ((pm.patient_id = mc.patient_id) AND (('now'::cstring)::date >= pm.reg_dt) AND (('now'::cstring)::date <= COALESCE(pm.unreg_dt, 'infinity'::date)))
442. 0.084 0.084 ↓ 2.5 43 1

Seq Scan on motherhood.mh_pregnant_map pm_1 (cost=0.00..3.25 rows=17 width=4) (actual time=0.032..0.084 rows=43 loops=1)

  • Output: pm_1.patient_id
  • Filter: ((('now'::cstring)::date >= pm_1.reg_dt) AND (('now'::cstring)::date <= COALESCE(pm_1.unreg_dt, 'infinity'::date)))
  • Rows Removed by Filter: 7
  • Buffers: shared hit=2
443. 0.055 0.150 ↑ 1.0 1 1

Nested Loop (cost=1,717.00..1,725.04 rows=1 width=117) (actual time=0.148..0.150 rows=1 loops=1)

  • Output: row_to_json(ROW(sr_service_3.id, sr_service_3.name))
  • Buffers: shared hit=4
444. 0.071 0.073 ↑ 1.0 1 1

HashAggregate (cost=1,716.58..1,716.59 rows=1 width=4) (actual time=0.073..0.073 rows=1 loops=1)

  • Output: (COALESCE(CASE WHEN (ssrss.id IS NULL) THEN CASE WHEN (ma.service_id IS NULL) THEN CASE WHEN ($161 > 1) THEN NULL::integer ELSE CASE WHEN ($163 > 1) THEN NULL::integer ELSE $165 END END ELSE ma.service_id END ELSE ssrss.id END, $168))
  • Group Key: COALESCE(CASE WHEN (ssrss.id IS NULL) THEN CASE WHEN (ma.service_id IS NULL) THEN CASE WHEN ($161 > 1) THEN NULL::integer ELSE CASE WHEN ($163 > 1) THEN NULL::integer ELSE $165 END END ELSE ma.service_id END ELSE ssrss.id END, $168)
445. 0.002 0.002 ↑ 1.0 1 1

Result (cost=1,716.55..1,716.57 rows=1 width=0) (actual time=0.002..0.002 rows=1 loops=1)

  • Output: COALESCE(CASE WHEN (ssrss.id IS NULL) THEN CASE WHEN (ma.service_id IS NULL) THEN CASE WHEN ($161 > 1) THEN NULL::integer ELSE CASE WHEN ($163 > 1) THEN NULL::integer ELSE $165 END END ELSE ma.service_id END ELSE ssrss.id END, $168)
446.          

Initplan (for Result)

447. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=453.09..453.10 rows=1 width=0) (never executed)

  • Output: count(*)
448. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on public.sr_res_group srg_13 (cost=445.07..453.09 rows=2 width=0) (never executed)

  • Output: srg_13.id, srg_13.bdate, srg_13.edate, srg_13.is_system, srg_13.name, srg_13.department_id, srg_13.org_id, srg_13.responsible_id, srg_13.is_available_in_electronic_queue, srg_13.label_id, srg_13.ignore_regclinic_check, srg_13.note, srg_13.blocked, srg_13.block_comment, srg_13.template_res_group_id, srg_13.aud_who, srg_13.aud_when, srg_13.aud_source, srg_13.aud_who_create, srg_13.aud_when_create, srg_13.aud_source_create, srg_13.emergency, srg_13.ignore_districts, srg_13.service_template_id
  • Recheck Cond: ((NOT srg_13.is_system) AND (srg_13.responsible_id = 78020))
449. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=445.07..445.07 rows=2 width=0) (never executed)

450. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_id_is_system_ix (cost=0.00..190.69 rows=11,681 width=0) (never executed)

451. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_responsible_id_id_ix (cost=0.00..254.13 rows=13,008 width=0) (never executed)

  • Index Cond: (srg_13.responsible_id = 78020)
452. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=484.31..484.32 rows=1 width=96) (never executed)

  • Output: count(srgs_4.*)
453.          

Initplan (for Aggregate)

454. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on public.sr_res_group srg_14 (cost=445.07..453.09 rows=2 width=4) (never executed)

  • Output: srg_14.id
  • Recheck Cond: ((NOT srg_14.is_system) AND (srg_14.responsible_id = 78020))
455. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=445.07..445.07 rows=2 width=0) (never executed)

456. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_id_is_system_ix (cost=0.00..190.69 rows=11,681 width=0) (never executed)

457. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_responsible_id_id_ix (cost=0.00..254.13 rows=13,008 width=0) (never executed)

  • Index Cond: (srg_14.responsible_id = 78020)
458. 0.000 0.000 ↓ 0.0 0

Index Scan using sr_res_group_service_group_id_idx on public.sr_res_group_service srgs_4 (cost=0.43..31.22 rows=2 width=96) (never executed)

  • Output: srgs_4.*
  • Index Cond: (srgs_4.group_id = $162)
  • Filter: srgs_4.default_service
459. 0.000 0.000 ↓ 0.0 0

Index Scan using sr_res_group_service_group_id_idx on public.sr_res_group_service srgs_5 (cost=453.52..484.31 rows=2 width=4) (never executed)

  • Output: srgs_5.srv_type_id
  • Index Cond: (srgs_5.group_id = $164)
  • Filter: srgs_5.default_service
460.          

Initplan (for Index Scan)

461. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on public.sr_res_group srg_15 (cost=445.07..453.09 rows=2 width=4) (never executed)

  • Output: srg_15.id
  • Recheck Cond: ((NOT srg_15.is_system) AND (srg_15.responsible_id = 78020))
462. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=445.07..445.07 rows=2 width=0) (never executed)

463. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_id_is_system_ix (cost=0.00..190.69 rows=11,681 width=0) (never executed)

464. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_responsible_id_id_ix (cost=0.00..254.13 rows=13,008 width=0) (never executed)

  • Index Cond: (srg_15.responsible_id = 78020)
465. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.58..294.82 rows=1 width=111) (never executed)

  • Output: ((((t_12.fields_model)::json -> 'service'::text) ->> 'id'::text))::integer
466. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.30..294.36 rows=1 width=4) (never executed)

  • Output: tak_12.template_id
467. 0.000 0.000 ↓ 0.0 0

Seq Scan on sec.access_key ak_12 (cost=0.00..283.33 rows=1 width=4) (never executed)

  • Output: ak_12.id, ak_12.type_id, ak_12.org_id, ak_12.empl_pos_id, ak_12.user_id, ak_12.name, ak_12.is_blocked, ak_12.aud_who, ak_12.aud_when, ak_12.aud_source, ak_12.aud_who_create, ak_12.aud_when_create, ak_12.aud_source_create
  • Filter: ((ak_12.empl_pos_id = 78020) AND (ak_12.org_id = 1805760))
468. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on def.template_access_key tak_12 (cost=4.30..11.01 rows=2 width=8) (never executed)

  • Output: tak_12.id, tak_12.template_id, tak_12.access_key_id, tak_12.is_primary, tak_12.is_author, tak_12.aud_who, tak_12.aud_when, tak_12.aud_source, tak_12.aud_who_create, tak_12.aud_when_create, tak_12.aud_source_create
  • Recheck Cond: (tak_12.access_key_id = ak_12.id)
469. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on idx_template_access_key_access_key_di (cost=0.00..4.29 rows=2 width=0) (never executed)

  • Index Cond: (tak_12.access_key_id = ak_12.id)
470. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_template on def.template t_12 (cost=0.28..0.43 rows=1 width=115) (never executed)

  • Output: t_12.id, t_12.name, t_12.page_id, t_12.container_id, t_12.widget_id, t_12.fields_model, t_12.filters_model, t_12.aud_who, t_12.aud_when, t_12.aud_source, t_12.aud_who_create, t_12.aud_when_create, t_12.aud_source_create
  • Index Cond: (t_12.id = tak_12.template_id)
  • Filter: ((t_12.page_id = 'resultAdmissionMain'::text) AND (t_12.container_id = 'admissionCase'::text))
471. 0.022 0.022 ↑ 1.0 1 1

Index Scan using sr_service_pk on public.sr_service sr_service_3 (cost=0.42..8.44 rows=1 width=117) (actual time=0.022..0.022 rows=1 loops=1)

  • Output: sr_service_3.id, sr_service_3.code, sr_service_3.cul, sr_service_3.is_death, sr_service_3.duration, sr_service_3.is_fictitious, sr_service_3.is_independent, sr_service_3.is_multuplicity, sr_service_3.name, sr_service_3.terms, sr_service_3.org_id, sr_service_3.category_id, sr_service_3.duration_unit_id, sr_service_3.prototype_id, sr_service_3.type_id, sr_service_3.from_dt, sr_service_3.to_dt, sr_service_3.is_repeated, sr_service_3.is_inherit_protocol, sr_service_3.is_expendable_materials, sr_service_3.is_actual_cul, sr_service_3.is_paraclinical, sr_service_3.is_complex, sr_service_3.accounting_id, sr_service_3.is_fact, sr_service_3.is_autocopy_diagnoses, sr_service_3.is_stomat, sr_service_3.srg_dif_type_id, sr_service_3.srg_opr_kind_id, sr_service_3.is_need_anatomic_zone, sr_service_3.aud_who, sr_service_3.aud_when, sr_service_3.aud_source, sr_service_3.aud_who_create, sr_service_3.aud_when_create, sr_service_3.aud_source_create, sr_service_3.is_filling, sr_service_3.is_extraction, sr_service_3.is_need_close_date, sr_service_3.is_vmp, sr_service_3.short_name
  • Index Cond: (sr_service_3.id = (COALESCE(CASE WHEN (ssrss.id IS NULL) THEN CASE WHEN (ma.service_id IS NULL) THEN CASE WHEN ($161 > 1) THEN NULL::integer ELSE CASE WHEN ($163 > 1) THEN NULL::integer ELSE $165 END END ELSE ma.service_id END ELSE ssrss.id END, $168)))
  • Buffers: shared hit=4
472. 0.035 0.051 ↑ 1.0 1 1

Result (cost=2.19..2.21 rows=1 width=0) (actual time=0.051..0.051 rows=1 loops=1)

  • Output: ($175 <@ $177)
  • Buffers: shared hit=2
473.          

Initplan (for Result)

474. 0.007 0.007 ↑ 1.0 8 1

Seq Scan on public.evaluation_patient_condition_criteria_directory (cost=0.00..1.08 rows=8 width=4) (actual time=0.007..0.007 rows=8 loops=1)

  • Output: evaluation_patient_condition_criteria_directory.id
  • Buffers: shared hit=1
475. 0.009 0.009 ↓ 0.0 0 1

Seq Scan on public.evaluation_patient_condition_criteria_value epccv (cost=0.00..1.11 rows=1 width=4) (actual time=0.009..0.009 rows=0 loops=1)

  • Output: epccv.criteria_id
  • Filter: (epccv.step_id = ms.id)
  • Rows Removed by Filter: 9
  • Buffers: shared hit=1
476. 0.027 0.153 ↑ 1.0 1 1

Aggregate (cost=104.79..104.81 rows=1 width=4) (actual time=0.153..0.153 rows=1 loops=1)

  • Output: array_to_json(array_agg(row_to_json(ROW(res.id))))
  • Buffers: shared hit=6
477. 0.016 0.126 ↓ 0.0 0 1

Nested Loop (cost=2.23..104.71 rows=16 width=4) (actual time=0.126..0.126 rows=0 loops=1)

  • Output: res.id
  • Buffers: shared hit=6
478. 0.045 0.110 ↓ 0.0 0 1

Hash Join (cost=1.94..28.51 rows=17 width=4) (actual time=0.110..0.110 rows=0 loops=1)

  • Output: sgr.resource_id
  • Hash Cond: (sgr.role_id = rrol.id)
  • Buffers: shared hit=6
479. 0.029 0.029 ↑ 242.0 1 1

Index Scan using sr_res_group_relationship__group_id_ix on public.sr_res_group_relationship sgr (cost=0.57..26.05 rows=242 width=8) (actual time=0.029..0.029 rows=1 loops=1)

  • Output: sgr.id, sgr.bdatetime, sgr.edatetime, sgr.resource_id, sgr.group_id, sgr.role_id, sgr.is_disabled, sgr.aud_who, sgr.aud_when, sgr.aud_source, sgr.aud_who_create, sgr.aud_when_create, sgr.aud_source_create, sgr._is_system
  • Index Cond: (sgr.group_id = srgrg.id)
  • Buffers: shared hit=5
480. 0.017 0.036 ↑ 1.0 2 1

Hash (cost=1.35..1.35 rows=2 width=4) (actual time=0.036..0.036 rows=2 loops=1)

  • Output: rrol.id
  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
  • Buffers: shared hit=1
481. 0.019 0.019 ↑ 1.0 2 1

Seq Scan on public.sr_res_role rrol (cost=0.00..1.35 rows=2 width=4) (actual time=0.015..0.019 rows=2 loops=1)

  • Output: rrol.id
  • Filter: ((rrol.code)::text = 'NURSE'::text)
  • Rows Removed by Filter: 26
  • Buffers: shared hit=1
482. 0.000 0.000 ↓ 0.0 0

Index Only Scan using sr_resource_pk on public.sr_resource res (cost=0.29..4.47 rows=1 width=4) (never executed)

  • Output: res.id
  • Index Cond: (res.id = sgr.resource_id)
  • Heap Fetches: 0
483. 0.009 0.149 ↓ 0.0 0 1

Nested Loop (cost=6.75..25.70 rows=1 width=4) (actual time=0.149..0.149 rows=0 loops=1)

  • Output: zrd.id
  • Buffers: shared hit=1
484. 0.010 0.140 ↓ 0.0 0 1

Nested Loop (cost=6.47..21.99 rows=1 width=8) (actual time=0.140..0.140 rows=0 loops=1)

  • Output: zrd.id, zrd.mkb_id
  • Buffers: shared hit=1
485. 0.045 0.130 ↓ 0.0 0 1

Nested Loop (cost=6.47..20.94 rows=1 width=12) (actual time=0.130..0.130 rows=0 loops=1)

  • Output: zrd.id, zrd.mkb_id, r_2.kind_id
  • Buffers: shared hit=1
486. 0.035 0.085 ↓ 0.0 0 1

Nested Loop (cost=4.31..13.41 rows=1 width=8) (actual time=0.085..0.085 rows=0 loops=1)

  • Output: a.id, r_2.kind_id
  • Join Filter: (a.register_id = r_2.id)
  • Buffers: shared hit=1
487. 0.021 0.021 ↑ 1.0 1 1

Seq Scan on d_accounting.register r_2 (cost=0.00..1.27 rows=1 width=8) (actual time=0.020..0.021 rows=1 loops=1)

  • Output: r_2.id, r_2.code, r_2.name, 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.is_social_significant, r_2.type_id, r_2.begin_date, r_2.end_date, r_2.is_removed, r_2.kind_id
  • Filter: (r_2.kind_id = 1)
  • Rows Removed by Filter: 21
  • Buffers: shared hit=1
488. 0.025 0.029 ↓ 0.0 0 1

Bitmap Heap Scan on d_accounting.account a (cost=4.31..12.11 rows=2 width=8) (actual time=0.029..0.029 rows=0 loops=1)

  • Output: a.id, a.num, a.reg_dt, a.unreg_dt, a.patient_uid, a.fun_source_id, a.clinic_id, a.reg_doctor_id, a.reg_cond_id, a.pat_state_id, a.trust_org_id, a.trust_ind_id, a.hiv_result_id, a.hiv_reg_dt, a.is_removed, a.removed_dt, a.rmv_reason_id, a.rmv_descr, a.rmv_doctor_id, a.death_reas_id, a.death_info, a.disability_id, a.is_war_inval, a.is_veteran, a.is_learner, a.education_id, a.class_number, a.marit_stat_id, a.livelihood_id, a.resident_num_id, a.domicile_id, a.register_id, a.stage_id, a.is_toxic, a.aud_who, a.aud_when, a.aud_source, a.aud_who_create, a.aud_when_create, a.aud_source_create, a.clinic_district_id, a.epidem_conclusion_number, a.unreg_doctor_id, a.commission_id, a.commission_issue_id, a.patient_id, a.mkb_id, a.unreg_reason_id, a.cancel_clinic_id, a.observation_clinic_id, a.death_date, a.death_reason_mkb_id, a.comment, a.autopsy_id, a.autopsy_result_id
  • Recheck Cond: (a.patient_id = ra.patient_id)
489. 0.004 0.004 ↓ 0.0 0 1

Bitmap Index Scan on account_patient_id_ix (cost=0.00..4.30 rows=2 width=0) (actual time=0.004..0.004 rows=0 loops=1)

  • Index Cond: (a.patient_id = ra.patient_id)
490. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on oncology.zno_reg_data zrd (cost=2.16..7.50 rows=2 width=12) (never executed)

  • Output: zrd.id, zrd.account_id, zrd.first_date, zrd.first_clinic_id, zrd.mkb_id, zrd.mkb_date, zrd.register_clinic_id, zrd.multi_diagnosis_id, zrd.side_id, zrd.stage_id, zrd.stage_t_id, zrd.stage_n_id, zrd.stage_m_id, zrd.number, zrd.morph_type_id, zrd.is_main, zrd.circumstances_id, zrd.date_in, zrd.reg_kind_id, zrd.late_reason_id, zrd.aud_who, zrd.aud_when, zrd.aud_source, zrd.aud_who_create, zrd.aud_when_create, zrd.aud_source_create
  • Recheck Cond: (zrd.account_id = a.id)
491. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on zno_reg_data_account_id_ix (cost=0.00..2.16 rows=2 width=0) (never executed)

  • Index Cond: (zrd.account_id = a.id)
492. 0.000 0.000 ↓ 0.0 0

Seq Scan on d_accounting.register_kind rk (cost=0.00..1.04 rows=1 width=4) (never executed)

  • Output: rk.id, rk.name, rk.aud_who, rk.aud_when, rk.aud_source, rk.aud_who_create, rk.aud_when_create, rk.aud_source_create
  • Filter: (rk.id = 1)
493. 0.000 0.000 ↓ 0.0 0

Index Scan using md_diagnosis_pk on public.md_diagnosis mdd (cost=0.29..3.71 rows=1 width=4) (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 = zrd.mkb_id)
  • Filter: CASE WHEN (((mdd.code)::text >= 'C43.0'::text) AND ((mdd.code)::text <= 'C44.9'::text)) THEN ((md1.code)::text = (mdd.code)::text) ELSE ("substring"((mdd.code)::text, 1, 3) = "substring"((md1.code)::text, 1, 3)) END
494. 0.009 0.115 ↑ 1.0 1 1

Limit (cost=1.14..9.79 rows=1 width=4) (actual time=0.115..0.115 rows=1 loops=1)

  • Output: sr_srv_rendered.bdate
  • Buffers: shared hit=10
495. 0.067 0.106 ↑ 886.0 1 1

Nested Loop (cost=1.14..7,669.83 rows=886 width=4) (actual time=0.106..0.106 rows=1 loops=1)

  • Output: sr_srv_rendered.bdate
  • Buffers: shared hit=10
496. 0.023 0.023 ↑ 886.0 1 1

Index Scan using md_srv_rendered_step_id_idx on public.md_srv_rendered (cost=0.57..58.66 rows=886 width=4) (actual time=0.023..0.023 rows=1 loops=1)

  • Output: md_srv_rendered.id, md_srv_rendered.is_urgent, md_srv_rendered.is_use_cryogenic, md_srv_rendered.is_use_endoscopic, md_srv_rendered.is_use_laser, md_srv_rendered.anesthesia_type_id, md_srv_rendered.step_id, md_srv_rendered.complication_type_id, md_srv_rendered.diagnosis_id, md_srv_rendered.case_id, md_srv_rendered.referral_id, md_srv_rendered.result_category_id, md_srv_rendered.patient_prescription_id, md_srv_rendered.health_group_id, md_srv_rendered.vmp_type_id, md_srv_rendered.vmp_method_id, md_srv_rendered.anatomic_zone_id, md_srv_rendered.aud_who, md_srv_rendered.aud_when, md_srv_rendered.aud_source, md_srv_rendered.aud_who_create, md_srv_rendered.aud_when_create, md_srv_rendered.aud_source_create, md_srv_rendered.prescription_id, md_srv_rendered.by_standard, md_srv_rendered.complicated_value, md_srv_rendered.vmp_profile_id
  • Index Cond: (md_srv_rendered.step_id = ms.id)
  • Buffers: shared hit=5
497. 0.016 0.016 ↑ 1.0 1 1

Index Scan using sr_srv_rendered_pk on public.sr_srv_rendered (cost=0.57..8.58 rows=1 width=8) (actual time=0.016..0.016 rows=1 loops=1)

  • Output: sr_srv_rendered.id, sr_srv_rendered.bdate, sr_srv_rendered.comment, sr_srv_rendered.cost, sr_srv_rendered.duration, sr_srv_rendered.edate, sr_srv_rendered.is_rendered, sr_srv_rendered.quantity, sr_srv_rendered.total_cost, sr_srv_rendered.contract_id, sr_srv_rendered.customer_id, sr_srv_rendered.funding_id, sr_srv_rendered.res_group_id, sr_srv_rendered.service_id, sr_srv_rendered.duration_measure_unit_id, sr_srv_rendered.begin_time, sr_srv_rendered.prototype_id, sr_srv_rendered.org_id, sr_srv_rendered.price_list_id, sr_srv_rendered.cul, sr_srv_rendered.parent_id, sr_srv_rendered.payment_status_id, sr_srv_rendered.root_service_id, sr_srv_rendered.is_wholly_rendered, sr_srv_rendered.planned_date, sr_srv_rendered.planned_time, sr_srv_rendered.tooth_number, sr_srv_rendered.is_refused, sr_srv_rendered.aud_who, sr_srv_rendered.aud_when, sr_srv_rendered.aud_source, sr_srv_rendered.aud_who_create, sr_srv_rendered.aud_when_create, sr_srv_rendered.aud_source_create, sr_srv_rendered.is_amalgam_filling, sr_srv_rendered.is_mobile_medical_teams, sr_srv_rendered.close_date, sr_srv_rendered.complex_srv_id, sr_srv_rendered.for_upload, sr_srv_rendered.uid, sr_srv_rendered.is_need_consulting
  • Index Cond: (sr_srv_rendered.id = md_srv_rendered.id)
  • Buffers: shared hit=5
498. 0.031 0.121 ↑ 1.0 1 1

Nested Loop (cost=1,717.00..1,725.04 rows=1 width=117) (actual time=0.119..0.121 rows=1 loops=1)

  • Output: row_to_json(ROW(sr_service_4.id, sr_service_4.name))
  • Buffers: shared hit=4
499. 0.071 0.075 ↑ 1.0 1 1

HashAggregate (cost=1,716.58..1,716.59 rows=1 width=4) (actual time=0.074..0.075 rows=1 loops=1)

  • Output: (COALESCE(CASE WHEN (ssrss.id IS NULL) THEN CASE WHEN (ma.service_id IS NULL) THEN CASE WHEN ($186 > 1) THEN NULL::integer ELSE CASE WHEN ($188 > 1) THEN NULL::integer ELSE $190 END END ELSE ma.service_id END ELSE ssrss.id END, $193))
  • Group Key: COALESCE(CASE WHEN (ssrss.id IS NULL) THEN CASE WHEN (ma.service_id IS NULL) THEN CASE WHEN ($186 > 1) THEN NULL::integer ELSE CASE WHEN ($188 > 1) THEN NULL::integer ELSE $190 END END ELSE ma.service_id END ELSE ssrss.id END, $193)
500. 0.004 0.004 ↑ 1.0 1 1

Result (cost=1,716.55..1,716.57 rows=1 width=0) (actual time=0.004..0.004 rows=1 loops=1)

  • Output: COALESCE(CASE WHEN (ssrss.id IS NULL) THEN CASE WHEN (ma.service_id IS NULL) THEN CASE WHEN ($186 > 1) THEN NULL::integer ELSE CASE WHEN ($188 > 1) THEN NULL::integer ELSE $190 END END ELSE ma.service_id END ELSE ssrss.id END, $193)
501.          

Initplan (for Result)

502. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=453.09..453.10 rows=1 width=0) (never executed)

  • Output: count(*)
503. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on public.sr_res_group srg_16 (cost=445.07..453.09 rows=2 width=0) (never executed)

  • Output: srg_16.id, srg_16.bdate, srg_16.edate, srg_16.is_system, srg_16.name, srg_16.department_id, srg_16.org_id, srg_16.responsible_id, srg_16.is_available_in_electronic_queue, srg_16.label_id, srg_16.ignore_regclinic_check, srg_16.note, srg_16.blocked, srg_16.block_comment, srg_16.template_res_group_id, srg_16.aud_who, srg_16.aud_when, srg_16.aud_source, srg_16.aud_who_create, srg_16.aud_when_create, srg_16.aud_source_create, srg_16.emergency, srg_16.ignore_districts, srg_16.service_template_id
  • Recheck Cond: ((NOT srg_16.is_system) AND (srg_16.responsible_id = 78020))
504. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=445.07..445.07 rows=2 width=0) (never executed)

505. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_id_is_system_ix (cost=0.00..190.69 rows=11,681 width=0) (never executed)

506. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_responsible_id_id_ix (cost=0.00..254.13 rows=13,008 width=0) (never executed)

  • Index Cond: (srg_16.responsible_id = 78020)
507. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=484.31..484.32 rows=1 width=96) (never executed)

  • Output: count(srgs_6.*)
508.          

Initplan (for Aggregate)

509. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on public.sr_res_group srg_17 (cost=445.07..453.09 rows=2 width=4) (never executed)

  • Output: srg_17.id
  • Recheck Cond: ((NOT srg_17.is_system) AND (srg_17.responsible_id = 78020))
510. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=445.07..445.07 rows=2 width=0) (never executed)

511. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_id_is_system_ix (cost=0.00..190.69 rows=11,681 width=0) (never executed)

512. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_responsible_id_id_ix (cost=0.00..254.13 rows=13,008 width=0) (never executed)

  • Index Cond: (srg_17.responsible_id = 78020)
513. 0.000 0.000 ↓ 0.0 0

Index Scan using sr_res_group_service_group_id_idx on public.sr_res_group_service srgs_6 (cost=0.43..31.22 rows=2 width=96) (never executed)

  • Output: srgs_6.*
  • Index Cond: (srgs_6.group_id = $187)
  • Filter: srgs_6.default_service
514. 0.000 0.000 ↓ 0.0 0

Index Scan using sr_res_group_service_group_id_idx on public.sr_res_group_service srgs_7 (cost=453.52..484.31 rows=2 width=4) (never executed)

  • Output: srgs_7.srv_type_id
  • Index Cond: (srgs_7.group_id = $189)
  • Filter: srgs_7.default_service
515.          

Initplan (for Index Scan)

516. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on public.sr_res_group srg_18 (cost=445.07..453.09 rows=2 width=4) (never executed)

  • Output: srg_18.id
  • Recheck Cond: ((NOT srg_18.is_system) AND (srg_18.responsible_id = 78020))
517. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=445.07..445.07 rows=2 width=0) (never executed)

518. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_id_is_system_ix (cost=0.00..190.69 rows=11,681 width=0) (never executed)

519. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_responsible_id_id_ix (cost=0.00..254.13 rows=13,008 width=0) (never executed)

  • Index Cond: (srg_18.responsible_id = 78020)
520. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.58..294.82 rows=1 width=111) (never executed)

  • Output: ((((t_14.fields_model)::json -> 'serviceRes'::text) ->> 'id'::text))::integer
521. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.30..294.36 rows=1 width=4) (never executed)

  • Output: tak_14.template_id
522. 0.000 0.000 ↓ 0.0 0

Seq Scan on sec.access_key ak_14 (cost=0.00..283.33 rows=1 width=4) (never executed)

  • Output: ak_14.id, ak_14.type_id, ak_14.org_id, ak_14.empl_pos_id, ak_14.user_id, ak_14.name, ak_14.is_blocked, ak_14.aud_who, ak_14.aud_when, ak_14.aud_source, ak_14.aud_who_create, ak_14.aud_when_create, ak_14.aud_source_create
  • Filter: ((ak_14.empl_pos_id = 78020) AND (ak_14.org_id = 1805760))
523. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on def.template_access_key tak_14 (cost=4.30..11.01 rows=2 width=8) (never executed)

  • Output: tak_14.id, tak_14.template_id, tak_14.access_key_id, tak_14.is_primary, tak_14.is_author, tak_14.aud_who, tak_14.aud_when, tak_14.aud_source, tak_14.aud_who_create, tak_14.aud_when_create, tak_14.aud_source_create
  • Recheck Cond: (tak_14.access_key_id = ak_14.id)
524. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on idx_template_access_key_access_key_di (cost=0.00..4.29 rows=2 width=0) (never executed)

  • Index Cond: (tak_14.access_key_id = ak_14.id)
525. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_template on def.template t_14 (cost=0.28..0.43 rows=1 width=115) (never executed)

  • Output: t_14.id, t_14.name, t_14.page_id, t_14.container_id, t_14.widget_id, t_14.fields_model, t_14.filters_model, t_14.aud_who, t_14.aud_when, t_14.aud_source, t_14.aud_who_create, t_14.aud_when_create, t_14.aud_source_create
  • Index Cond: (t_14.id = tak_14.template_id)
  • Filter: ((t_14.page_id = 'resultAdmissionMain'::text) AND (t_14.container_id = 'admissionCase'::text))
526. 0.015 0.015 ↑ 1.0 1 1

Index Scan using sr_service_pk on public.sr_service sr_service_4 (cost=0.42..8.44 rows=1 width=117) (actual time=0.015..0.015 rows=1 loops=1)

  • Output: sr_service_4.id, sr_service_4.code, sr_service_4.cul, sr_service_4.is_death, sr_service_4.duration, sr_service_4.is_fictitious, sr_service_4.is_independent, sr_service_4.is_multuplicity, sr_service_4.name, sr_service_4.terms, sr_service_4.org_id, sr_service_4.category_id, sr_service_4.duration_unit_id, sr_service_4.prototype_id, sr_service_4.type_id, sr_service_4.from_dt, sr_service_4.to_dt, sr_service_4.is_repeated, sr_service_4.is_inherit_protocol, sr_service_4.is_expendable_materials, sr_service_4.is_actual_cul, sr_service_4.is_paraclinical, sr_service_4.is_complex, sr_service_4.accounting_id, sr_service_4.is_fact, sr_service_4.is_autocopy_diagnoses, sr_service_4.is_stomat, sr_service_4.srg_dif_type_id, sr_service_4.srg_opr_kind_id, sr_service_4.is_need_anatomic_zone, sr_service_4.aud_who, sr_service_4.aud_when, sr_service_4.aud_source, sr_service_4.aud_who_create, sr_service_4.aud_when_create, sr_service_4.aud_source_create, sr_service_4.is_filling, sr_service_4.is_extraction, sr_service_4.is_need_close_date, sr_service_4.is_vmp, sr_service_4.short_name
  • Index Cond: (sr_service_4.id = (COALESCE(CASE WHEN (ssrss.id IS NULL) THEN CASE WHEN (ma.service_id IS NULL) THEN CASE WHEN ($186 > 1) THEN NULL::integer ELSE CASE WHEN ($188 > 1) THEN NULL::integer ELSE $190 END END ELSE ma.service_id END ELSE ssrss.id END, $193)))
  • Buffers: shared hit=4
527. 0.071 0.161 ↑ 1.0 1 1

Nested Loop (cost=1,717.00..1,725.04 rows=1 width=117) (actual time=0.159..0.161 rows=1 loops=1)

  • Output: row_to_json(ROW(sr_service_5.id, sr_service_5.name))
  • Buffers: shared hit=4
528. 0.071 0.075 ↑ 1.0 1 1

HashAggregate (cost=1,716.58..1,716.59 rows=1 width=4) (actual time=0.074..0.075 rows=1 loops=1)

  • Output: (COALESCE(CASE WHEN (ssrss.id IS NULL) THEN CASE WHEN (ma.service_id IS NULL) THEN CASE WHEN ($197 > 1) THEN NULL::integer ELSE CASE WHEN ($199 > 1) THEN NULL::integer ELSE $201 END END ELSE ma.service_id END ELSE ssrss.id END, $204))
  • Group Key: COALESCE(CASE WHEN (ssrss.id IS NULL) THEN CASE WHEN (ma.service_id IS NULL) THEN CASE WHEN ($197 > 1) THEN NULL::integer ELSE CASE WHEN ($199 > 1) THEN NULL::integer ELSE $201 END END ELSE ma.service_id END ELSE ssrss.id END, $204)
529. 0.004 0.004 ↑ 1.0 1 1

Result (cost=1,716.55..1,716.57 rows=1 width=0) (actual time=0.004..0.004 rows=1 loops=1)

  • Output: COALESCE(CASE WHEN (ssrss.id IS NULL) THEN CASE WHEN (ma.service_id IS NULL) THEN CASE WHEN ($197 > 1) THEN NULL::integer ELSE CASE WHEN ($199 > 1) THEN NULL::integer ELSE $201 END END ELSE ma.service_id END ELSE ssrss.id END, $204)
530.          

Initplan (for Result)

531. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=453.09..453.10 rows=1 width=0) (never executed)

  • Output: count(*)
532. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on public.sr_res_group srg_19 (cost=445.07..453.09 rows=2 width=0) (never executed)

  • Output: srg_19.id, srg_19.bdate, srg_19.edate, srg_19.is_system, srg_19.name, srg_19.department_id, srg_19.org_id, srg_19.responsible_id, srg_19.is_available_in_electronic_queue, srg_19.label_id, srg_19.ignore_regclinic_check, srg_19.note, srg_19.blocked, srg_19.block_comment, srg_19.template_res_group_id, srg_19.aud_who, srg_19.aud_when, srg_19.aud_source, srg_19.aud_who_create, srg_19.aud_when_create, srg_19.aud_source_create, srg_19.emergency, srg_19.ignore_districts, srg_19.service_template_id
  • Recheck Cond: ((NOT srg_19.is_system) AND (srg_19.responsible_id = 78020))
533. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=445.07..445.07 rows=2 width=0) (never executed)

534. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_id_is_system_ix (cost=0.00..190.69 rows=11,681 width=0) (never executed)

535. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_responsible_id_id_ix (cost=0.00..254.13 rows=13,008 width=0) (never executed)

  • Index Cond: (srg_19.responsible_id = 78020)
536. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=484.31..484.32 rows=1 width=96) (never executed)

  • Output: count(srgs_8.*)
537.          

Initplan (for Aggregate)

538. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on public.sr_res_group srg_20 (cost=445.07..453.09 rows=2 width=4) (never executed)

  • Output: srg_20.id
  • Recheck Cond: ((NOT srg_20.is_system) AND (srg_20.responsible_id = 78020))
539. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=445.07..445.07 rows=2 width=0) (never executed)

540. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_id_is_system_ix (cost=0.00..190.69 rows=11,681 width=0) (never executed)

541. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_responsible_id_id_ix (cost=0.00..254.13 rows=13,008 width=0) (never executed)

  • Index Cond: (srg_20.responsible_id = 78020)
542. 0.000 0.000 ↓ 0.0 0

Index Scan using sr_res_group_service_group_id_idx on public.sr_res_group_service srgs_8 (cost=0.43..31.22 rows=2 width=96) (never executed)

  • Output: srgs_8.*
  • Index Cond: (srgs_8.group_id = $198)
  • Filter: srgs_8.default_service
543. 0.000 0.000 ↓ 0.0 0

Index Scan using sr_res_group_service_group_id_idx on public.sr_res_group_service srgs_9 (cost=453.52..484.31 rows=2 width=4) (never executed)

  • Output: srgs_9.srv_type_id
  • Index Cond: (srgs_9.group_id = $200)
  • Filter: srgs_9.default_service
544.          

Initplan (for Index Scan)

545. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on public.sr_res_group srg_21 (cost=445.07..453.09 rows=2 width=4) (never executed)

  • Output: srg_21.id
  • Recheck Cond: ((NOT srg_21.is_system) AND (srg_21.responsible_id = 78020))
546. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=445.07..445.07 rows=2 width=0) (never executed)

547. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_id_is_system_ix (cost=0.00..190.69 rows=11,681 width=0) (never executed)

548. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on sr_res_group_responsible_id_id_ix (cost=0.00..254.13 rows=13,008 width=0) (never executed)

  • Index Cond: (srg_21.responsible_id = 78020)
549. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.58..294.82 rows=1 width=111) (never executed)

  • Output: ((((t_15.fields_model)::json -> 'serviceMO'::text) ->> 'id'::text))::integer
550. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.30..294.36 rows=1 width=4) (never executed)

  • Output: tak_15.template_id
551. 0.000 0.000 ↓ 0.0 0

Seq Scan on sec.access_key ak_15 (cost=0.00..283.33 rows=1 width=4) (never executed)

  • Output: ak_15.id, ak_15.type_id, ak_15.org_id, ak_15.empl_pos_id, ak_15.user_id, ak_15.name, ak_15.is_blocked, ak_15.aud_who, ak_15.aud_when, ak_15.aud_source, ak_15.aud_who_create, ak_15.aud_when_create, ak_15.aud_source_create
  • Filter: ((ak_15.empl_pos_id = 78020) AND (ak_15.org_id = 1805760))
552. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on def.template_access_key tak_15 (cost=4.30..11.01 rows=2 width=8) (never executed)

  • Output: tak_15.id, tak_15.template_id, tak_15.access_key_id, tak_15.is_primary, tak_15.is_author, tak_15.aud_who, tak_15.aud_when, tak_15.aud_source, tak_15.aud_who_create, tak_15.aud_when_create, tak_15.aud_source_create
  • Recheck Cond: (tak_15.access_key_id = ak_15.id)
553. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on idx_template_access_key_access_key_di (cost=0.00..4.29 rows=2 width=0) (never executed)

  • Index Cond: (tak_15.access_key_id = ak_15.id)
554. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_template on def.template t_15 (cost=0.28..0.43 rows=1 width=115) (never executed)

  • Output: t_15.id, t_15.name, t_15.page_id, t_15.container_id, t_15.widget_id, t_15.fields_model, t_15.filters_model, t_15.aud_who, t_15.aud_when, t_15.aud_source, t_15.aud_who_create, t_15.aud_when_create, t_15.aud_source_create
  • Index Cond: (t_15.id = tak_15.template_id)
  • Filter: ((t_15.page_id = 'resultAdmissionMain'::text) AND (t_15.container_id = 'admissionCase'::text))
555. 0.015 0.015 ↑ 1.0 1 1

Index Scan using sr_service_pk on public.sr_service sr_service_5 (cost=0.42..8.44 rows=1 width=117) (actual time=0.014..0.015 rows=1 loops=1)

  • Output: sr_service_5.id, sr_service_5.code, sr_service_5.cul, sr_service_5.is_death, sr_service_5.duration, sr_service_5.is_fictitious, sr_service_5.is_independent, sr_service_5.is_multuplicity, sr_service_5.name, sr_service_5.terms, sr_service_5.org_id, sr_service_5.category_id, sr_service_5.duration_unit_id, sr_service_5.prototype_id, sr_service_5.type_id, sr_service_5.from_dt, sr_service_5.to_dt, sr_service_5.is_repeated, sr_service_5.is_inherit_protocol, sr_service_5.is_expendable_materials, sr_service_5.is_actual_cul, sr_service_5.is_paraclinical, sr_service_5.is_complex, sr_service_5.accounting_id, sr_service_5.is_fact, sr_service_5.is_autocopy_diagnoses, sr_service_5.is_stomat, sr_service_5.srg_dif_type_id, sr_service_5.srg_opr_kind_id, sr_service_5.is_need_anatomic_zone, sr_service_5.aud_who, sr_service_5.aud_when, sr_service_5.aud_source, sr_service_5.aud_who_create, sr_service_5.aud_when_create, sr_service_5.aud_source_create, sr_service_5.is_filling, sr_service_5.is_extraction, sr_service_5.is_need_close_date, sr_service_5.is_vmp, sr_service_5.short_name
  • Index Cond: (sr_service_5.id = (COALESCE(CASE WHEN (ssrss.id IS NULL) THEN CASE WHEN (ma.service_id IS NULL) THEN CASE WHEN ($197 > 1) THEN NULL::integer ELSE CASE WHEN ($199 > 1) THEN NULL::integer ELSE $201 END END ELSE ma.service_id END ELSE ssrss.id END, $204)))
  • Buffers: shared hit=4
Planning time : 148.327 ms
Execution time : 478.900 ms