explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PnaS

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

Limit (cost=7,797.92..29,017.98 rows=1 width=1,512) (actual time=49.611..49.682 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=22450
2.          

Initplan (for Limit)

3. 0.002 0.062 ↓ 0.0 0 1

Bitmap Heap Scan on public.cmn_setting_value (cost=4.43..15.65 rows=3 width=73) (actual time=0.062..0.062 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.060 0.060 ↓ 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.060..0.060 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.026 0.026 ↑ 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.026..0.026 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=444.79..444.80 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=436.77..444.78 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=436.77..436.77 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..185.21 rows=11,443 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..251.31 rows=13,165 width=0) (never executed)

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

Aggregate (cost=453.09..453.10 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=436.77..444.78 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=436.77..436.77 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..185.21 rows=11,443 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..251.31 rows=13,165 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=445.07..453.09 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=436.77..444.78 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=436.77..436.77 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..185.21 rows=11,443 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..251.31 rows=13,165 width=0) (never executed)

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

Aggregate (cost=444.79..444.80 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=436.77..444.78 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=436.77..436.77 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..185.21 rows=11,443 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..251.31 rows=13,165 width=0) (never executed)

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

Aggregate (cost=453.09..453.10 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=436.77..444.78 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=436.77..436.77 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..185.21 rows=11,443 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..251.31 rows=13,165 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=461.56..465.37 rows=2 width=64) (never executed)

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

Unique (cost=461.42..461.43 rows=2 width=4) (never executed)

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

Sort (cost=461.42..461.42 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=437.05..461.41 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=436.77..444.78 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=436.77..436.77 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..185.21 rows=11,443 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..251.31 rows=13,165 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..1.96 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.087 0.087 ↑ 1.0 1 1

Seq Scan on public.md_clinic (cost=0.00..7.67 rows=1 width=1) (actual time=0.070..0.087 rows=1 loops=1)

  • Output: md_clinic.priv_rec_for_unreg_pat
  • Filter: (md_clinic.id = 1805760)
  • Rows Removed by Filter: 135
  • Buffers: shared hit=6
47. 0.001 0.010 ↑ 1.0 1 1

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

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

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

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

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

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

Aggregate (cost=444.79..444.80 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=436.77..444.78 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=436.77..436.77 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..185.21 rows=11,443 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..251.31 rows=13,165 width=0) (never executed)

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

Aggregate (cost=460.30..460.31 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=436.77..444.78 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=436.77..436.77 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..185.21 rows=11,443 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..251.31 rows=13,165 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..15.51 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=460.72..468.76 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=436.77..444.78 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=436.77..436.77 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..185.21 rows=11,443 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..251.31 rows=13,165 width=0) (never executed)

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

HashAggregate (cost=15.52..15.53 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..15.51 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.104 2.220 ↑ 4.0 1 1

Nested Loop Semi Join (cost=4.58..280.53 rows=4 width=33) (actual time=2.214..2.220 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=184
72. 0.004 0.004 ↑ 1.0 8 1

Seq Scan on public.fin_funding_source_type (cost=0.00..1.08 rows=8 width=33) (actual time=0.004..0.004 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.010 2.112 ↑ 1.0 1 8

Materialize (cost=4.58..279.18 rows=1 width=112) (actual time=0.149..0.264 rows=1 loops=8)

  • Output: t.fields_model
  • Buffers: shared hit=183
74. 0.004 2.102 ↑ 1.0 1 1

Nested Loop (cost=4.58..279.18 rows=1 width=112) (actual time=1.185..2.102 rows=1 loops=1)

  • Output: t.fields_model
  • Buffers: shared hit=183
75. 0.007 2.078 ↑ 1.0 1 1

Nested Loop (cost=4.30..278.74 rows=1 width=4) (actual time=1.163..2.078 rows=1 loops=1)

  • Output: tak.template_id
  • Buffers: shared hit=180
76. 2.047 2.047 ↑ 1.0 1 1

Seq Scan on sec.access_key ak (cost=0.00..267.81 rows=1 width=4) (actual time=1.132..2.047 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: 6048
  • Buffers: shared hit=177
77. 0.009 0.024 ↑ 2.0 1 1

Bitmap Heap Scan on def.template_access_key tak (cost=4.30..10.91 rows=2 width=8) (actual time=0.024..0.024 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.015 0.015 ↑ 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.015..0.015 rows=1 loops=1)

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

Index Scan using pk_template on def.template t (cost=0.28..0.43 rows=1 width=116) (actual time=0.019..0.020 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.065 0.862 ↑ 2.0 1 1

Nested Loop Semi Join (cost=4.58..280.36 rows=2 width=53) (actual time=0.839..0.862 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: 7
  • Buffers: shared hit=184
81. 0.005 0.005 ↓ 2.0 8 1

Seq Scan on public.mc_case_type (cost=0.00..1.04 rows=4 width=53) (actual time=0.004..0.005 rows=8 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.007 0.792 ↑ 1.0 1 8

Materialize (cost=4.58..279.18 rows=1 width=112) (actual time=0.058..0.099 rows=1 loops=8)

  • Output: t_1.fields_model
  • Buffers: shared hit=183
83. 0.003 0.785 ↑ 1.0 1 1

Nested Loop (cost=4.58..279.18 rows=1 width=112) (actual time=0.458..0.785 rows=1 loops=1)

  • Output: t_1.fields_model
  • Buffers: shared hit=183
84. 0.007 0.776 ↑ 1.0 1 1

Nested Loop (cost=4.30..278.74 rows=1 width=4) (actual time=0.450..0.776 rows=1 loops=1)

  • Output: tak_1.template_id
  • Buffers: shared hit=180
85. 0.758 0.758 ↑ 1.0 1 1

Seq Scan on sec.access_key ak_1 (cost=0.00..267.81 rows=1 width=4) (actual time=0.433..0.758 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: 6048
  • Buffers: shared hit=177
86. 0.003 0.011 ↑ 2.0 1 1

Bitmap Heap Scan on def.template_access_key tak_1 (cost=4.30..10.91 rows=2 width=8) (actual time=0.010..0.011 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.008 0.008 ↑ 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.008..0.008 rows=1 loops=1)

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

Index Scan using pk_template on def.template t_1 (cost=0.28..0.43 rows=1 width=116) (actual time=0.006..0.006 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.048 0.842 ↓ 0.0 0 1

Nested Loop Semi Join (cost=4.58..280.49 rows=4 width=45) (actual time=0.842..0.842 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=184
90. 0.003 0.003 ↑ 1.0 7 1

Seq Scan on public.mc_care_regimen (cost=0.00..1.07 rows=7 width=45) (actual time=0.003..0.003 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.010 0.791 ↑ 1.0 1 7

Materialize (cost=4.58..279.18 rows=1 width=112) (actual time=0.066..0.113 rows=1 loops=7)

  • Output: t_2.fields_model
  • Buffers: shared hit=183
92. 0.005 0.781 ↑ 1.0 1 1

Nested Loop (cost=4.58..279.18 rows=1 width=112) (actual time=0.457..0.781 rows=1 loops=1)

  • Output: t_2.fields_model
  • Buffers: shared hit=183
93. 0.003 0.770 ↑ 1.0 1 1

Nested Loop (cost=4.30..278.74 rows=1 width=4) (actual time=0.448..0.770 rows=1 loops=1)

  • Output: tak_2.template_id
  • Buffers: shared hit=180
94. 0.757 0.757 ↑ 1.0 1 1

Seq Scan on sec.access_key ak_2 (cost=0.00..267.81 rows=1 width=4) (actual time=0.435..0.757 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: 6048
  • Buffers: shared hit=177
95. 0.007 0.010 ↑ 2.0 1 1

Bitmap Heap Scan on def.template_access_key tak_2 (cost=4.30..10.91 rows=2 width=8) (actual time=0.010..0.010 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.003 0.003 ↑ 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.003..0.003 rows=1 loops=1)

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

Index Scan using pk_template on def.template t_2 (cost=0.28..0.43 rows=1 width=116) (actual time=0.006..0.006 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.048 0.052 ↑ 1.0 1 1

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

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

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

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

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

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

Nested Loop Semi Join (cost=4.58..280.66 rows=6 width=77) (actual time=0.854..0.854 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=184
102. 0.008 0.008 ↑ 1.0 11 1

Seq Scan on public.mc_care_level (cost=0.00..1.11 rows=11 width=77) (actual time=0.006..0.008 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.004 0.781 ↑ 1.0 1 11

Materialize (cost=4.58..279.18 rows=1 width=112) (actual time=0.041..0.071 rows=1 loops=11)

  • Output: t_3.fields_model
  • Buffers: shared hit=183
104. 0.004 0.777 ↑ 1.0 1 1

Nested Loop (cost=4.58..279.18 rows=1 width=112) (actual time=0.453..0.777 rows=1 loops=1)

  • Output: t_3.fields_model
  • Buffers: shared hit=183
105. 0.005 0.767 ↑ 1.0 1 1

Nested Loop (cost=4.30..278.74 rows=1 width=4) (actual time=0.443..0.767 rows=1 loops=1)

  • Output: tak_3.template_id
  • Buffers: shared hit=180
106. 0.753 0.753 ↑ 1.0 1 1

Seq Scan on sec.access_key ak_3 (cost=0.00..267.81 rows=1 width=4) (actual time=0.429..0.753 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: 6048
  • Buffers: shared hit=177
107. 0.005 0.009 ↑ 2.0 1 1

Bitmap Heap Scan on def.template_access_key tak_3 (cost=4.30..10.91 rows=2 width=8) (actual time=0.009..0.009 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.004 0.004 ↑ 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.004..0.004 rows=1 loops=1)

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

Index Scan using pk_template on def.template t_3 (cost=0.28..0.43 rows=1 width=116) (actual time=0.006..0.006 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.054 0.849 ↓ 0.0 0 1

Nested Loop Semi Join (cost=4.58..280.49 rows=4 width=45) (actual time=0.849..0.849 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=184
111. 0.004 0.004 ↑ 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.002..0.004 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.013 0.791 ↑ 1.0 1 7

Materialize (cost=4.58..279.18 rows=1 width=112) (actual time=0.064..0.113 rows=1 loops=7)

  • Output: t_4.fields_model
  • Buffers: shared hit=183
113. 0.002 0.778 ↑ 1.0 1 1

Nested Loop (cost=4.58..279.18 rows=1 width=112) (actual time=0.433..0.778 rows=1 loops=1)

  • Output: t_4.fields_model
  • Buffers: shared hit=183
114. 0.005 0.770 ↑ 1.0 1 1

Nested Loop (cost=4.30..278.74 rows=1 width=4) (actual time=0.425..0.770 rows=1 loops=1)

  • Output: tak_4.template_id
  • Buffers: shared hit=180
115. 0.759 0.759 ↑ 1.0 1 1

Seq Scan on sec.access_key ak_4 (cost=0.00..267.81 rows=1 width=4) (actual time=0.416..0.759 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: 6048
  • Buffers: shared hit=177
116. 0.003 0.006 ↑ 2.0 1 1

Bitmap Heap Scan on def.template_access_key tak_4 (cost=4.30..10.91 rows=2 width=8) (actual time=0.005..0.006 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.003 0.003 ↑ 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.003..0.003 rows=1 loops=1)

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

Index Scan using pk_template on def.template t_4 (cost=0.28..0.43 rows=1 width=116) (actual time=0.006..0.006 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.031 0.862 ↑ 16.0 1 1

Nested Loop (cost=279.34..279.44 rows=16 width=80) (actual time=0.861..0.862 rows=1 loops=1)

  • Output: row_to_json(ROW(mc_case_init_goal.id, mc_case_init_goal.name))
  • Buffers: shared hit=185
120. 0.007 0.824 ↑ 1.0 1 1

HashAggregate (cost=279.18..279.19 rows=1 width=112) (actual time=0.824..0.824 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=183
121. 0.019 0.817 ↑ 1.0 1 1

Nested Loop (cost=4.58..279.18 rows=1 width=112) (actual time=0.469..0.817 rows=1 loops=1)

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

Nested Loop (cost=4.30..278.74 rows=1 width=4) (actual time=0.444..0.792 rows=1 loops=1)

  • Output: tak_5.template_id
  • Buffers: shared hit=180
123. 0.780 0.780 ↑ 1.0 1 1

Seq Scan on sec.access_key ak_5 (cost=0.00..267.81 rows=1 width=4) (actual time=0.433..0.780 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: 6048
  • Buffers: shared hit=177
124. 0.002 0.006 ↑ 2.0 1 1

Bitmap Heap Scan on def.template_access_key tak_5 (cost=4.30..10.91 rows=2 width=8) (actual time=0.005..0.006 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.004 0.004 ↑ 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.004..0.004 rows=1 loops=1)

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

Index Scan using pk_template on def.template t_5 (cost=0.28..0.43 rows=1 width=116) (actual time=0.006..0.006 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.007 0.007 ↑ 1.0 1 1

Index Scan using mc_case_init_goal_pk on public.mc_case_init_goal (cost=0.15..0.20 rows=1 width=80) (actual time=0.006..0.007 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.036 0.809 ↑ 2.0 1 1

Nested Loop Semi Join (cost=4.58..280.31 rows=2 width=23) (actual time=0.808..0.809 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=184
129. 0.005 0.005 ↑ 1.0 3 1

Seq Scan on public.md_care_providing_form (cost=0.00..1.03 rows=3 width=23) (actual time=0.004..0.005 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.004 0.768 ↑ 1.0 1 3

Materialize (cost=4.58..279.18 rows=1 width=112) (actual time=0.149..0.256 rows=1 loops=3)

  • Output: t_6.fields_model
  • Buffers: shared hit=183
131. 0.004 0.764 ↑ 1.0 1 1

Nested Loop (cost=4.58..279.18 rows=1 width=112) (actual time=0.441..0.764 rows=1 loops=1)

  • Output: t_6.fields_model
  • Buffers: shared hit=183
132. 0.005 0.753 ↑ 1.0 1 1

Nested Loop (cost=4.30..278.74 rows=1 width=4) (actual time=0.432..0.753 rows=1 loops=1)

  • Output: tak_6.template_id
  • Buffers: shared hit=180
133. 0.738 0.738 ↑ 1.0 1 1

Seq Scan on sec.access_key ak_6 (cost=0.00..267.81 rows=1 width=4) (actual time=0.417..0.738 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: 6048
  • Buffers: shared hit=177
134. 0.007 0.010 ↑ 2.0 1 1

Bitmap Heap Scan on def.template_access_key tak_6 (cost=4.30..10.91 rows=2 width=8) (actual time=0.010..0.010 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.003 0.003 ↑ 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.003..0.003 rows=1 loops=1)

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

Index Scan using pk_template on def.template t_6 (cost=0.28..0.43 rows=1 width=116) (actual time=0.006..0.007 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.053 0.832 ↓ 0.0 0 1

Nested Loop Semi Join (cost=4.58..280.44 rows=3 width=30) (actual time=0.832..0.832 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=184
138. 0.005 0.005 ↑ 1.0 6 1

Seq Scan on public.md_care_provision_condition (cost=0.00..1.06 rows=6 width=30) (actual time=0.003..0.005 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.009 0.774 ↑ 1.0 1 6

Materialize (cost=4.58..279.18 rows=1 width=112) (actual time=0.075..0.129 rows=1 loops=6)

  • Output: t_7.fields_model
  • Buffers: shared hit=183
140. 0.003 0.765 ↑ 1.0 1 1

Nested Loop (cost=4.58..279.18 rows=1 width=112) (actual time=0.442..0.765 rows=1 loops=1)

  • Output: t_7.fields_model
  • Buffers: shared hit=183
141. 0.006 0.757 ↑ 1.0 1 1

Nested Loop (cost=4.30..278.74 rows=1 width=4) (actual time=0.435..0.757 rows=1 loops=1)

  • Output: tak_7.template_id
  • Buffers: shared hit=180
142. 0.746 0.746 ↑ 1.0 1 1

Seq Scan on sec.access_key ak_7 (cost=0.00..267.81 rows=1 width=4) (actual time=0.424..0.746 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: 6048
  • Buffers: shared hit=177
143. 0.002 0.005 ↑ 2.0 1 1

Bitmap Heap Scan on def.template_access_key tak_7 (cost=4.30..10.91 rows=2 width=8) (actual time=0.005..0.005 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.003 0.003 ↑ 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.003..0.003 rows=1 loops=1)

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

Index Scan using pk_template on def.template t_7 (cost=0.28..0.43 rows=1 width=116) (actual time=0.005..0.005 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.017 0.811 ↓ 0.0 0 1

Nested Loop (cost=279.34..279.47 rows=26 width=136) (actual time=0.811..0.811 rows=0 loops=1)

  • Output: row_to_json(ROW(mc_payment_method.id, mc_payment_method.name))
  • Buffers: shared hit=183
147. 0.006 0.793 ↑ 1.0 1 1

HashAggregate (cost=279.18..279.19 rows=1 width=112) (actual time=0.793..0.793 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=183
148. 0.021 0.787 ↑ 1.0 1 1

Nested Loop (cost=4.58..279.18 rows=1 width=112) (actual time=0.463..0.787 rows=1 loops=1)

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

Nested Loop (cost=4.30..278.74 rows=1 width=4) (actual time=0.437..0.760 rows=1 loops=1)

  • Output: tak_8.template_id
  • Buffers: shared hit=180
150. 0.750 0.750 ↑ 1.0 1 1

Seq Scan on sec.access_key ak_8 (cost=0.00..267.81 rows=1 width=4) (actual time=0.427..0.750 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: 6048
  • Buffers: shared hit=177
151. 0.003 0.006 ↑ 2.0 1 1

Bitmap Heap Scan on def.template_access_key tak_8 (cost=4.30..10.91 rows=2 width=8) (actual time=0.006..0.006 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.003 0.003 ↑ 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.003..0.003 rows=1 loops=1)

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

Index Scan using pk_template on def.template t_8 (cost=0.28..0.43 rows=1 width=116) (actual time=0.006..0.006 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.001 0.001 ↓ 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.001..0.001 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.028 0.816 ↓ 0.0 0 1

Nested Loop Semi Join (cost=4.58..280.39 rows=2 width=20) (actual time=0.816..0.816 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=184
156. 0.008 0.008 ↑ 1.0 5 1

Seq Scan on public.plc_visit_place (cost=0.00..1.05 rows=5 width=20) (actual time=0.008..0.008 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.008 0.780 ↑ 1.0 1 5

Materialize (cost=4.58..279.18 rows=1 width=112) (actual time=0.091..0.156 rows=1 loops=5)

  • Output: t_9.fields_model
  • Buffers: shared hit=183
158. 0.002 0.772 ↑ 1.0 1 1

Nested Loop (cost=4.58..279.18 rows=1 width=112) (actual time=0.450..0.772 rows=1 loops=1)

  • Output: t_9.fields_model
  • Buffers: shared hit=183
159. 0.006 0.764 ↑ 1.0 1 1

Nested Loop (cost=4.30..278.74 rows=1 width=4) (actual time=0.442..0.764 rows=1 loops=1)

  • Output: tak_9.template_id
  • Buffers: shared hit=180
160. 0.748 0.748 ↑ 1.0 1 1

Seq Scan on sec.access_key ak_9 (cost=0.00..267.81 rows=1 width=4) (actual time=0.427..0.748 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: 6048
  • Buffers: shared hit=177
161. 0.007 0.010 ↑ 2.0 1 1

Bitmap Heap Scan on def.template_access_key tak_9 (cost=4.30..10.91 rows=2 width=8) (actual time=0.010..0.010 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.003 0.003 ↑ 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.003..0.003 rows=1 loops=1)

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

Index Scan using pk_template on def.template t_9 (cost=0.28..0.43 rows=1 width=116) (actual time=0.006..0.006 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.013 0.013 ↑ 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.012..0.013 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.026 0.852 ↑ 88.0 1 1

Nested Loop (cost=279.34..279.66 rows=88 width=68) (actual time=0.851..0.852 rows=1 loops=1)

  • Output: row_to_json(ROW(md_profile.id, md_profile.name))
  • Buffers: shared hit=185
166. 0.009 0.819 ↑ 1.0 1 1

HashAggregate (cost=279.18..279.19 rows=1 width=112) (actual time=0.819..0.819 rows=1 loops=1)

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

Nested Loop (cost=4.58..279.18 rows=1 width=112) (actual time=0.452..0.810 rows=1 loops=1)

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

Nested Loop (cost=4.30..278.74 rows=1 width=4) (actual time=0.426..0.783 rows=1 loops=1)

  • Output: tak_10.template_id
  • Buffers: shared hit=180
169. 0.774 0.774 ↑ 1.0 1 1

Seq Scan on sec.access_key ak_10 (cost=0.00..267.81 rows=1 width=4) (actual time=0.417..0.774 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: 6048
  • Buffers: shared hit=177
170. 0.002 0.005 ↑ 2.0 1 1

Bitmap Heap Scan on def.template_access_key tak_10 (cost=4.30..10.91 rows=2 width=8) (actual time=0.005..0.005 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.003 0.003 ↑ 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.003..0.003 rows=1 loops=1)

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

Index Scan using pk_template on def.template t_10 (cost=0.28..0.43 rows=1 width=116) (actual time=0.006..0.006 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.007 0.007 ↑ 1.0 1 1

Index Scan using md_profile_pk on public.md_profile (cost=0.16..0.24 rows=1 width=68) (actual time=0.006..0.007 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.018 0.826 ↓ 0.0 0 1

Nested Loop (cost=279.48..300.70 rows=7,464 width=121) (actual time=0.826..0.826 rows=0 loops=1)

  • Output: row_to_json(ROW(md_diagnosis.id, md_diagnosis.name))
  • Buffers: shared hit=183
175. 0.005 0.807 ↑ 1.0 1 1

HashAggregate (cost=279.18..279.19 rows=1 width=112) (actual time=0.807..0.807 rows=1 loops=1)

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

Nested Loop (cost=4.58..279.18 rows=1 width=112) (actual time=0.463..0.802 rows=1 loops=1)

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

Nested Loop (cost=4.30..278.74 rows=1 width=4) (actual time=0.431..0.769 rows=1 loops=1)

  • Output: tak_11.template_id
  • Buffers: shared hit=180
178. 0.758 0.758 ↑ 1.0 1 1

Seq Scan on sec.access_key ak_11 (cost=0.00..267.81 rows=1 width=4) (actual time=0.420..0.758 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: 6048
  • Buffers: shared hit=177
179. 0.002 0.005 ↑ 2.0 1 1

Bitmap Heap Scan on def.template_access_key tak_11 (cost=4.30..10.91 rows=2 width=8) (actual time=0.005..0.005 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.003 0.003 ↑ 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.003..0.003 rows=1 loops=1)

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

Index Scan using pk_template on def.template t_11 (cost=0.28..0.43 rows=1 width=116) (actual time=0.006..0.007 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.001 0.001 ↓ 0.0 0 1

Index Scan using md_diagnosis_pk on public.md_diagnosis (cost=0.30..2.83 rows=1 width=121) (actual time=0.001..0.001 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.034 0.810 ↓ 0.0 0 1

Nested Loop Semi Join (cost=4.58..280.51 rows=4 width=43) (actual time=0.810..0.810 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=184
184. 0.008 0.008 ↑ 1.0 8 1

Seq Scan on public.mc_disease_type (cost=0.00..1.08 rows=8 width=43) (actual time=0.006..0.008 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.008 0.768 ↑ 1.0 1 8

Materialize (cost=4.58..279.18 rows=1 width=112) (actual time=0.055..0.096 rows=1 loops=8)

  • Output: t_13.fields_model
  • Buffers: shared hit=183
186. 0.004 0.760 ↑ 1.0 1 1

Nested Loop (cost=4.58..279.18 rows=1 width=112) (actual time=0.438..0.760 rows=1 loops=1)

  • Output: t_13.fields_model
  • Buffers: shared hit=183
187. 0.003 0.749 ↑ 1.0 1 1

Nested Loop (cost=4.30..278.74 rows=1 width=4) (actual time=0.429..0.749 rows=1 loops=1)

  • Output: tak_13.template_id
  • Buffers: shared hit=180
188. 0.737 0.737 ↑ 1.0 1 1

Seq Scan on sec.access_key ak_13 (cost=0.00..267.81 rows=1 width=4) (actual time=0.417..0.737 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: 6048
  • Buffers: shared hit=177
189. 0.005 0.009 ↑ 2.0 1 1

Bitmap Heap Scan on def.template_access_key tak_13 (cost=4.30..10.91 rows=2 width=8) (actual time=0.009..0.009 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.004 0.004 ↑ 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.004..0.004 rows=1 loops=1)

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

Index Scan using pk_template on def.template t_13 (cost=0.28..0.43 rows=1 width=116) (actual time=0.006..0.007 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. 12.963 49.680 ↑ 1.0 1 1

Nested Loop Left Join (cost=10.14..21,230.20 rows=1 width=1,512) (actual time=49.609..49.680 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=22450
193. 0.002 0.604 ↑ 1.0 1 1

Nested Loop Left Join (cost=9.86..199.61 rows=1 width=1,390) (actual time=0.534..0.604 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=66
194. 0.002 0.602 ↑ 1.0 1 1

Nested Loop Left Join (cost=9.58..192.20 rows=1 width=1,332) (actual time=0.533..0.602 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=66
195. 0.003 0.600 ↑ 1.0 1 1

Nested Loop Left Join (cost=9.29..184.75 rows=1 width=1,219) (actual time=0.531..0.600 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=66
196. 0.008 0.597 ↑ 1.0 1 1

Nested Loop Left Join (cost=8.86..177.10 rows=1 width=1,159) (actual time=0.529..0.597 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=66
197. 0.002 0.586 ↑ 1.0 1 1

Nested Loop Left Join (cost=8.72..173.73 rows=1 width=1,155) (actual time=0.518..0.586 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=65
198. 0.005 0.583 ↑ 1.0 1 1

Nested Loop Left Join (cost=8.43..166.28 rows=1 width=1,033) (actual time=0.517..0.583 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=65
199. 0.003 0.557 ↑ 1.0 1 1

Nested Loop Left Join (cost=8.01..157.83 rows=1 width=1,028) (actual time=0.493..0.557 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=61
200. 0.002 0.554 ↑ 1.0 1 1

Nested Loop Left Join (cost=7.73..150.39 rows=1 width=906) (actual time=0.491..0.554 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=61
201. 0.000 0.532 ↑ 1.0 1 1

Nested Loop Left Join (cost=7.44..142.95 rows=1 width=783) (actual time=0.471..0.532 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=58
202. 0.004 0.502 ↑ 1.0 1 1

Nested Loop Left Join (cost=6.88..135.15 rows=1 width=762) (actual time=0.443..0.502 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=53
203. 0.009 0.498 ↑ 1.0 1 1

Nested Loop Left Join (cost=6.59..127.70 rows=1 width=762) (actual time=0.441..0.498 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=53
204. 0.003 0.489 ↑ 1.0 1 1

Nested Loop Left Join (cost=6.02..119.10 rows=1 width=758) (actual time=0.433..0.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
  • Buffers: shared hit=53
205. 0.003 0.464 ↑ 1.0 1 1

Nested Loop Left Join (cost=5.60..111.41 rows=1 width=713) (actual time=0.410..0.464 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=49
206. 0.002 0.439 ↑ 1.0 1 1

Nested Loop Left Join (cost=5.31..103.93 rows=1 width=705) (actual time=0.387..0.439 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=46
207. 0.003 0.407 ↑ 1.0 1 1

Nested Loop Left Join (cost=5.02..96.43 rows=1 width=701) (actual time=0.356..0.407 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=43
208. 0.009 0.369 ↑ 1.0 1 1

Nested Loop Left Join (cost=4.45..88.62 rows=1 width=693) (actual time=0.321..0.369 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
  • Join Filter: (mc.init_goal_id = mcig.id)
  • Rows Removed by Join Filter: 32
  • Buffers: shared hit=38
209. 0.007 0.343 ↑ 1.0 1 1

Nested Loop Left Join (cost=4.45..85.90 rows=1 width=615) (actual time=0.310..0.343 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
  • Join Filter: (mc.care_level_id = mcl.id)
  • Rows Removed by Join Filter: 10
  • Buffers: shared hit=36
210. 0.004 0.319 ↑ 1.0 1 1

Nested Loop Left Join (cost=4.45..84.66 rows=1 width=542) (actual time=0.291..0.319 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
  • Join Filter: (mc.provision_condition_id = mcpc.id)
  • Rows Removed by Join Filter: 6
  • Buffers: shared hit=35
211. 0.004 0.311 ↑ 1.0 1 1

Nested Loop Left Join (cost=4.45..83.52 rows=1 width=516) (actual time=0.284..0.311 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
  • Join Filter: (mc.funding_id = ffst.id)
  • Rows Removed by Join Filter: 7
  • Buffers: shared hit=34
212. 0.003 0.301 ↑ 1.0 1 1

Nested Loop Left Join (cost=4.45..82.34 rows=1 width=487) (actual time=0.278..0.301 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
  • Join Filter: (mc.care_providing_form_id = mcpf.id)
  • Rows Removed by Join Filter: 3
  • Buffers: shared hit=33
213. 0.022 0.295 ↑ 1.0 1 1

Nested Loop Left Join (cost=4.45..81.27 rows=1 width=468) (actual time=0.272..0.295 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
  • Join Filter: (mc.payment_method_id = mpm.id)
  • Rows Removed by Join Filter: 53
  • Buffers: shared hit=32
214. 0.006 0.254 ↑ 1.0 1 1

Nested Loop Left Join (cost=4.45..77.08 rows=1 width=336) (actual time=0.231..0.254 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
  • Join Filter: (mc.care_regimen_id = mcr.id)
  • Rows Removed by Join Filter: 6
  • Buffers: shared hit=29
215. 0.007 0.245 ↑ 1.0 1 1

Nested Loop Left Join (cost=4.45..75.92 rows=1 width=295) (actual time=0.226..0.245 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
  • Join Filter: (mc.case_type_id = mct.id)
  • Rows Removed by Join Filter: 7
  • Buffers: shared hit=28
216. 0.005 0.233 ↑ 1.0 1 1

Nested Loop Left Join (cost=4.45..74.83 rows=1 width=246) (actual time=0.218..0.233 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=27
217. 0.011 0.208 ↑ 1.0 1 1

Nested Loop Left Join (cost=4.01..67.17 rows=1 width=230) (actual time=0.197..0.208 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
  • Join Filter: (mc.admission_reason_id = mar.id)
  • Rows Removed by Join Filter: 15
  • Buffers: shared hit=23
218. 0.003 0.193 ↑ 1.0 1 1

Nested Loop Left Join (cost=4.01..65.83 rows=1 width=160) (actual time=0.182..0.193 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=22
219. 0.004 0.166 ↑ 1.0 1 1

Nested Loop Left Join (cost=3.57..58.17 rows=1 width=81) (actual time=0.158..0.166 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=18
220. 0.000 0.137 ↑ 1.0 1 1

Nested Loop Left Join (cost=3.14..49.70 rows=1 width=49) (actual time=0.132..0.137 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=14
221. 0.002 0.136 ↑ 1.0 1 1

Nested Loop Left Join (cost=2.57..41.90 rows=1 width=52) (actual time=0.131..0.136 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=14
222. 0.005 0.133 ↑ 1.0 1 1

Nested Loop Left Join (cost=2.13..34.24 rows=1 width=52) (actual time=0.129..0.133 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=14
223. 0.004 0.127 ↑ 1.0 1 1

Nested Loop Left Join (cost=1.70..25.77 rows=1 width=48) (actual time=0.123..0.127 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=14
224. 0.005 0.092 ↑ 1.0 1 1

Nested Loop (cost=1.14..17.18 rows=1 width=28) (actual time=0.090..0.092 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.050 0.050 ↑ 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.049..0.050 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 = 33040688)
  • Buffers: shared hit=5
226. 0.037 0.037 ↑ 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.036..0.037 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 = 33040688)
  • Buffers: shared hit=5
227. 0.031 0.031 ↓ 0.0 0 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.031..0.031 rows=0 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 = 33040688)
  • Buffers: shared hit=4
228. 0.001 0.001 ↓ 0.0 0 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.001..0.001 rows=0 loops=1)

  • Output: st.id
  • Index Cond: (st.id = ma.id)
  • Heap Fetches: 0
229. 0.001 0.001 ↓ 0.0 0 1

Index Scan using sr_session_ticket_ticket_id_idx on public.sr_session_ticket sst (cost=0.44..7.66 rows=1 width=8) (actual time=0.001..0.001 rows=0 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)
230. 0.001 0.001 ↓ 0.0 0 1

Index Scan using sr_session_pk on public.sr_session ss (cost=0.56..7.79 rows=1 width=5) (actual time=0.001..0.001 rows=0 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)
231. 0.025 0.025 ↑ 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.023..0.025 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.024 0.024 ↑ 1.0 1 1

Index Scan using mc_case_pk on public.mc_case mc (cost=0.44..7.65 rows=1 width=83) (actual time=0.022..0.024 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.004 0.004 ↑ 1.0 15 1

Seq Scan on public.mc_admission_reason mar (cost=0.00..1.15 rows=15 width=74) (actual time=0.004..0.004 rows=15 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
  • Buffers: shared hit=1
234. 0.020 0.020 ↑ 1.0 1 1

Index Scan using plc_visit_pk on public.plc_visit pv (cost=0.44..7.66 rows=1 width=20) (actual time=0.019..0.020 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.005 0.005 ↓ 2.0 8 1

Seq Scan on public.mc_case_type mct (cost=0.00..1.04 rows=4 width=53) (actual time=0.004..0.005 rows=8 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
  • Buffers: shared hit=1
236. 0.003 0.003 ↑ 1.0 7 1

Seq Scan on public.mc_care_regimen mcr (cost=0.00..1.07 rows=7 width=45) (actual time=0.003..0.003 rows=7 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
  • Buffers: shared hit=1
237. 0.019 0.019 ↑ 1.0 53 1

Seq Scan on public.mc_payment_method mpm (cost=0.00..3.53 rows=53 width=136) (actual time=0.002..0.019 rows=53 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
  • Buffers: shared hit=3
238. 0.003 0.003 ↑ 1.0 3 1

Seq Scan on public.md_care_providing_form mcpf (cost=0.00..1.03 rows=3 width=23) (actual time=0.003..0.003 rows=3 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
  • Buffers: shared hit=1
239. 0.006 0.006 ↑ 1.0 8 1

Seq Scan on public.fin_funding_source_type ffst (cost=0.00..1.08 rows=8 width=33) (actual time=0.003..0.006 rows=8 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
  • Buffers: shared hit=1
240. 0.004 0.004 ↑ 1.0 6 1

Seq Scan on public.md_care_provision_condition mcpc (cost=0.00..1.06 rows=6 width=30) (actual time=0.003..0.004 rows=6 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
  • Buffers: shared hit=1
241. 0.017 0.017 ↑ 1.0 11 1

Seq Scan on public.mc_care_level mcl (cost=0.00..1.11 rows=11 width=77) (actual time=0.015..0.017 rows=11 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
  • Buffers: shared hit=1
242. 0.017 0.017 ↓ 1.0 33 1

Seq Scan on public.mc_case_init_goal mcig (cost=0.00..2.32 rows=32 width=82) (actual time=0.007..0.017 rows=33 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
  • Buffers: shared hit=2
243. 0.035 0.035 ↑ 1.0 1 1

Index Scan using sr_res_group_pk on public.sr_res_group srgrg (cost=0.57..7.80 rows=1 width=8) (actual time=0.034..0.035 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.030 0.030 ↑ 1.0 1 1

Index Scan using pim_employee_position_pk on public.pim_employee_position peprg (cost=0.29..7.49 rows=1 width=8) (actual time=0.029..0.030 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.022 0.022 ↑ 1.0 1 1

Index Scan using pim_employee_pk on public.pim_employee perg (cost=0.29..7.47 rows=1 width=16) (actual time=0.021..0.022 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.022 0.022 ↑ 1.0 1 1

Index Scan using pim_individual_pk on public.pim_individual pirg (cost=0.43..7.69 rows=1 width=53) (actual time=0.021..0.022 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.000 0.000 ↓ 0.0 0 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.000..0.000 rows=0 loops=1)

  • Output: msrg.id
  • Index Cond: (msrg.id = ma.executor_id)
  • Heap Fetches: 0
248. 0.000 0.000 ↓ 0.0 0 1

Index Scan using sr_res_group_profile_res_group_id_idx on public.sr_res_group_profile srgp (cost=0.29..7.44 rows=1 width=8) (actual time=0.000..0.000 rows=0 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)
249. 0.030 0.030 ↑ 1.0 1 1

Index Scan using mc_diagnosis_pk on public.mc_diagnosis md (cost=0.56..7.79 rows=1 width=21) (actual time=0.028..0.030 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.020 0.020 ↑ 1.0 1 1

Index Scan using md_diagnosis_pk on public.md_diagnosis md1 (cost=0.29..7.43 rows=1 width=127) (actual time=0.018..0.020 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..7.43 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.021 0.021 ↑ 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.020..0.021 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.001 0.001 ↓ 0.0 0 1

Index Scan using md_diagnosis_pk on public.md_diagnosis md3 (cost=0.29..7.43 rows=1 width=126) (actual time=0.001..0.001 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.003 0.003 ↓ 0.0 0 1

Index Only Scan using reg_application_patient_id_ix on d_accounting.reg_application ra (cost=0.14..3.36 rows=1 width=4) (actual time=0.003..0.003 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..7.64 rows=1 width=68) (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.000 0.000 ↓ 0.0 0 1

Index Scan using pim_organization_pk on public.pim_organization ref_org (cost=0.29..7.45 rows=1 width=117) (actual time=0.000..0.000 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..7.39 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..7.43 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.005 0.092 ↑ 1.0 1 1

Nested Loop Left Join (cost=2.01..29.05 rows=1 width=4) (actual time=0.089..0.092 rows=1 loops=1)

  • Output: mc1.id
  • Buffers: shared hit=18
261. 0.002 0.071 ↑ 1.0 1 1

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

  • Output: ms1.case_id
  • Buffers: shared hit=14
262. 0.006 0.063 ↑ 1.0 1 1

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

  • Output: msr1.step_id
  • Buffers: shared hit=10
263. 0.050 0.050 ↑ 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.050..0.050 rows=1 loops=1)

  • Output: ssr1.id
  • Index Cond: (ssr1.id = ssr.id)
  • Heap Fetches: 0
  • Buffers: shared hit=5
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.006 0.006 ↑ 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.005..0.006 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.016 0.016 ↑ 1.0 1 1

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

  • Output: mc1.id
  • Index Cond: (mc1.id = ms1.case_id)
  • Heap Fetches: 0
  • Buffers: shared hit=4
267. 0.009 0.023 ↑ 1.0 1 1

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

  • Output: (((COALESCE(md1pr.code, ''::character varying))::text || ' '::text) || (COALESCE(md1pr.name, ''::character varying))::text)
  • Buffers: shared hit=8
268. 0.009 0.009 ↑ 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.009..0.009 rows=1 loops=1)

  • Output: mdpr.diagnos_id
  • Index Cond: (mdpr.id = mc.main_diagnos_id)
  • Buffers: shared hit=5
269. 0.005 0.005 ↑ 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.005 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.023 0.023 ↑ 1.0 1 1

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

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

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

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

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

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

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

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

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

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

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

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

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

  • Output: row_to_json(ROW(mcig.id, (((mcig.code)::text || ' - '::text) || (mcig.name)::text)))
277. 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(mcpc.id, mcpc.name))
278. 0.007 0.007 ↑ 1.0 1 1

Result (cost=0.00..0.02 rows=1 width=0) (actual time=0.007..0.007 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.006 0.006 ↑ 1.0 1 1

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

  • Output: row_to_json(ROW(md3.id, (((md3.code)::text || ' '::text) || (md3.name)::text)))
280. 0.036 0.036 ↑ 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.036..0.036 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.003 0.003 ↑ 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.002..0.003 rows=1 loops=1)

  • Output: pi.gender_id
  • Index Cond: (pi.id = ssr.customer_id)
  • Buffers: shared hit=4
282. 0.004 0.004 ↑ 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.004..0.004 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.011 0.011 ↑ 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.010..0.011 rows=1 loops=1)

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

Limit (cost=13.56..286.39 rows=1 width=4) (actual time=0.065..0.065 rows=1 loops=1)

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

Initplan (for Limit)

287. 0.001 0.027 ↑ 1.0 1 1

Limit (cost=12.55..12.56 rows=1 width=12) (actual time=0.027..0.027 rows=1 loops=1)

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

Aggregate (cost=12.55..12.56 rows=1 width=12) (actual time=0.026..0.026 rows=1 loops=1)

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

Index Scan using idx_mc_step on public.mc_step ms1_1 (cost=0.44..12.47 rows=15 width=12) (actual time=0.020..0.021 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.003 0.064 ↑ 1.0 1 1

Nested Loop (cost=1.00..273.83 rows=1 width=4) (actual time=0.064..0.064 rows=1 loops=1)

  • Output: mdpr_1.id
  • Buffers: shared hit=13
291. 0.024 0.024 ↑ 31.0 1 1

Index Scan using mc_diagnosis_case_id_idx on public.mc_diagnosis mdpr_1 (cost=0.56..11.26 rows=31 width=12) (actual time=0.024..0.024 rows=1 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=5
292. 0.037 0.037 ↑ 1.0 1 1

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

  • 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.012 0.023 ↑ 1.0 1 1

Nested Loop (cost=1,365.86..1,373.90 rows=1 width=115) (actual time=0.022..0.023 rows=1 loops=1)

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

HashAggregate (cost=1,365.44..1,365.45 rows=1 width=4) (actual time=0.005..0.005 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,365.41..1,365.42 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=444.79..444.80 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=436.77..444.78 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=436.77..436.77 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..185.21 rows=11,443 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..251.31 rows=13,165 width=0) (never executed)

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

Aggregate (cost=460.30..460.31 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=436.77..444.78 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=436.77..436.77 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..185.21 rows=11,443 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..251.31 rows=13,165 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..15.51 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=445.21..460.30 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=436.77..444.78 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=436.77..436.77 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..185.21 rows=11,443 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..251.31 rows=13,165 width=0) (never executed)

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

Index Scan using sr_service_pk on public.sr_service (cost=0.42..8.44 rows=1 width=115) (actual time=0.005..0.006 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.005 31.945 ↑ 1.0 1 1

Result (cost=4,904.50..4,904.51 rows=1 width=0) (actual time=31.945..31.945 rows=1 loops=1)

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

CTE services_pairs

318. 0.196 0.196 ↑ 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=122) (actual time=0.196..0.196 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.099 31.940 ↓ 0.0 0 1

Nested Loop (cost=1.42..691,597.35 rows=1,470 width=0) (actual time=31.940..31.940 rows=0 loops=1)

  • 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: 35
  • Buffers: shared hit=19464
321. 0.038 31.631 ↑ 4,209.5 35 1

Nested Loop (cost=1.42..686,440.76 rows=147,331 width=122) (actual time=0.109..31.631 rows=35 loops=1)

  • Output: s.code, s.name
  • Buffers: shared hit=19460
322. 2.789 31.418 ↑ 4,209.5 35 1

Nested Loop (cost=1.00..126,299.98 rows=147,331 width=4) (actual time=0.096..31.418 rows=35 loops=1)

  • Output: sr.srv_type_id
  • Buffers: shared hit=19312
323. 8.033 8.033 ↑ 2.6 5,149 1

Index Only Scan using sr_res_group_responsible_id_id_ix on public.sr_res_group rg (cost=0.57..4,769.56 rows=13,165 width=4) (actual time=0.055..8.033 rows=5,149 loops=1)

  • Output: rg.responsible_id, rg.id
  • Index Cond: (rg.responsible_id = 78020)
  • Heap Fetches: 3766
  • Buffers: shared hit=3846
324. 20.596 20.596 ↓ 0.0 0 5,149

Index Scan using sr_res_group_service_group_id_idx on public.sr_res_group_service sr (cost=0.43..9.12 rows=11 width=8) (actual time=0.004..0.004 rows=0 loops=5,149)

  • 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.group_id = rg.id)
  • Buffers: shared hit=15466
325. 0.175 0.175 ↑ 1.0 1 35

Index Scan using sr_service_pk on public.sr_service s (cost=0.42..3.79 rows=1 width=126) (actual time=0.005..0.005 rows=1 loops=35)

  • 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
  • Index Cond: (s.id = sr.srv_type_id)
  • Buffers: shared hit=148
326. 0.210 0.210 ↑ 1.0 1 35

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

  • Output: sp.second_service_code, sp.second_service_name
  • Buffers: shared hit=4
327. 0.000 0.000 ↓ 0.0 0

Limit (cost=1.42..4,424.02 rows=1 width=4) (never executed)

  • Output: s_1.id
328. 0.000 0.000 ↓ 0.0 0

Nested Loop Semi Join (cost=1.42..6,501,224.87 rows=1,470 width=4) (never executed)

  • Output: s_1.id
329. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.85..6,436,421.52 rows=23,348 width=8) (never executed)

  • Output: s_1.id, sr_1.group_id
330. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.42..766,311.94 rows=4,335 width=4) (never executed)

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

Index Scan Backward using sr_service_pk on public.sr_service s_1 (cost=0.42..751,101.63 rows=434,580 width=126) (never executed)

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

CTE Scan on services_pairs sp_1 (cost=0.00..0.02 rows=1 width=64) (never executed)

  • Output: sp_1.second_service_code, sp_1.second_service_name
333. 0.000 0.000 ↓ 0.0 0

Index Scan using sr_res_group_service_srv_type_id_idx on public.sr_res_group_service sr_1 (cost=0.43..1,297.63 rows=1,035 width=8) (never executed)

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

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

  • 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: 0
335. 0.046 0.046 ↑ 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.045..0.046 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.003 0.016 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.85..145.03 rows=1 width=521) (actual time=0.016..0.016 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.001 0.013 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.85..53.79 rows=1 width=508) (actual time=0.013..0.013 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.002 0.012 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.57..45.48 rows=1 width=386) (actual time=0.012..0.012 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.002 0.010 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.29..37.17 rows=1 width=328) (actual time=0.010..0.010 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.001 0.008 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.00..28.86 rows=1 width=328) (actual time=0.008..0.008 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.002 0.007 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.00..26.19 rows=1 width=263) (actual time=0.007..0.007 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.002 0.005 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.72..17.87 rows=1 width=146) (actual time=0.005..0.005 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.002 0.003 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.43..9.56 rows=1 width=83) (actual time=0.003..0.003 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.001 0.001 ↓ 0.0 0 1

Index Scan using md_referral_pk on public.md_referral mr (cost=0.43..8.45 rows=1 width=85) (actual time=0.001..0.001 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=67) (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=117) (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.54 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.54 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.87 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.56 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.29 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.002 0.034 ↓ 0.0 0 1

Limit (cost=2.16..54.54 rows=1 width=161) (actual time=0.034..0.034 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.002 0.032 ↓ 0.0 0 1

Nested Loop (cost=2.16..54.54 rows=1 width=161) (actual time=0.032..0.032 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.002 0.030 ↓ 0.0 0 1

Nested Loop (cost=1.88..45.87 rows=1 width=107) (actual time=0.030..0.030 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.001 0.028 ↓ 0.0 0 1

Nested Loop (cost=1.59..37.56 rows=1 width=53) (actual time=0.028..0.028 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.001 0.027 ↓ 0.0 0 1

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

  • Output: pim_employee_position_1.position_id, pim_employee_1.individual_id
384. 0.002 0.026 ↓ 0.0 0 1

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

  • Output: pim_employee_position_1.employee_id, pim_employee_position_1.position_id
385. 0.022 0.024 ↓ 0.0 0 1

Nested Loop (cost=0.58..16.62 rows=1 width=12) (actual time=0.024..0.024 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.29 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.007 0.082 ↑ 1.0 1 1

Nested Loop (cost=1.15..19.73 rows=1 width=4) (actual time=0.081..0.082 rows=1 loops=1)

  • Output: pe1.id
  • Buffers: shared hit=11
396. 0.007 0.031 ↑ 1.0 1 1

Nested Loop (cost=0.86..16.90 rows=1 width=4) (actual time=0.030..0.031 rows=1 loops=1)

  • Output: pep.employee_id
  • Buffers: shared hit=8
397. 0.014 0.014 ↑ 1.0 1 1

Index Scan using sr_res_group_pk on public.sr_res_group srg_9 (cost=0.57..8.59 rows=1 width=4) (actual time=0.014..0.014 rows=1 loops=1)

  • 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)
  • Buffers: shared hit=5
398. 0.010 0.010 ↑ 1.0 1 1

Index Scan using pim_employee_position_pk on public.pim_employee_position pep (cost=0.29..8.31 rows=1 width=8) (actual time=0.009..0.010 rows=1 loops=1)

  • 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)
  • Buffers: shared hit=3
399. 0.044 0.044 ↑ 1.0 1 1

Index Only Scan using pim_employee_pk on public.pim_employee pe1 (cost=0.29..2.81 rows=1 width=4) (actual time=0.044..0.044 rows=1 loops=1)

  • Output: pe1.id
  • Index Cond: (pe1.id = pep.employee_id)
  • Heap Fetches: 0
  • Buffers: shared hit=3
400. 0.006 0.023 ↑ 1.0 1 1

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

  • Output: srgg.is_system
  • Buffers: shared hit=10
401. 0.013 0.013 ↑ 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.013..0.013 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.004 0.004 ↑ 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.004..0.004 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.011 0.011 ↑ 1.0 1 1

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

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

Limit (cost=13.00..25.11 rows=1 width=4) (actual time=0.032..0.032 rows=1 loops=1)

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

Initplan (for Limit)

406. 0.002 0.012 ↑ 1.0 1 1

Limit (cost=12.55..12.56 rows=1 width=12) (actual time=0.012..0.012 rows=1 loops=1)

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

Aggregate (cost=12.55..12.56 rows=1 width=12) (actual time=0.010..0.010 rows=1 loops=1)

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

Index Scan using idx_mc_step on public.mc_step ms1_2 (cost=0.44..12.47 rows=15 width=12) (actual time=0.004..0.004 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.030 0.030 ↑ 1.0 1 1

Index Scan using idx_mc_step on public.mc_step ms_1 (cost=0.44..12.55 rows=1 width=4) (actual time=0.030..0.030 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.003 1.579 ↓ 0.0 0 1

Subquery Scan on l (cost=442.00..442.02 rows=1 width=51) (actual time=1.579..1.579 rows=0 loops=1)

  • Output: row_to_json(l.*)
  • Buffers: shared hit=121
411. 0.001 1.576 ↓ 0.0 0 1

Limit (cost=442.00..442.01 rows=1 width=31) (actual time=1.576..1.576 rows=0 loops=1)

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

Initplan (for Limit)

413. 0.000 0.000 ↓ 0.0 0

Limit (cost=212.79..212.80 rows=1 width=8) (never executed)

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

Aggregate (cost=212.79..212.80 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..212.78 rows=1 width=8) (never executed)

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

Sort (cost=229.21..229.21 rows=1 width=31) (actual time=1.575..1.575 rows=0 loops=1)

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

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

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

Seq Scan on public.pci_patient_card_place ppcp (cost=0.00..228.08 rows=1 width=8) (actual time=1.548..1.548 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: 6130
  • Buffers: shared hit=121
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.002 0.737 ↓ 0.0 0 1

Limit (cost=442.00..442.01 rows=1 width=8) (actual time=0.737..0.737 rows=0 loops=1)

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

Initplan (for Limit)

422. 0.000 0.000 ↓ 0.0 0

Limit (cost=212.79..212.80 rows=1 width=8) (never executed)

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

Aggregate (cost=212.79..212.80 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..212.78 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.012 0.735 ↓ 0.0 0 1

Sort (cost=229.21..229.21 rows=1 width=8) (actual time=0.735..0.735 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=121
426. 0.004 0.723 ↓ 0.0 0 1

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

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

Seq Scan on public.pci_patient_card_place ppcp_1 (cost=0.00..228.08 rows=1 width=8) (actual time=0.719..0.719 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: 6130
  • Buffers: shared hit=121
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.001 0.732 ↓ 0.0 0 1

Limit (cost=440.89..440.89 rows=1 width=8) (actual time=0.732..0.732 rows=0 loops=1)

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

Initplan (for Limit)

431. 0.000 0.000 ↓ 0.0 0

Limit (cost=212.79..212.80 rows=1 width=8) (never executed)

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

Aggregate (cost=212.79..212.80 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..212.78 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.011 0.731 ↓ 0.0 0 1

Sort (cost=228.09..228.10 rows=1 width=8) (actual time=0.731..0.731 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=121
435. 0.720 0.720 ↓ 0.0 0 1

Seq Scan on public.pci_patient_card_place ppcp_2 (cost=0.00..228.08 rows=1 width=8) (actual time=0.720..0.720 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: 6130
  • Buffers: shared hit=121
436. 0.008 0.075 ↑ 1.0 1 1

Aggregate (cost=7,665.30..7,665.31 rows=1 width=4) (actual time=0.075..0.075 rows=1 loops=1)

  • Output: count(fbsi.id)
  • Buffers: shared hit=18
437. 0.006 0.067 ↑ 382.0 1 1

Nested Loop (cost=1.00..7,664.34 rows=382 width=4) (actual time=0.059..0.067 rows=1 loops=1)

  • Output: fbsi.id
  • Buffers: shared hit=18
438. 0.037 0.037 ↑ 225.2 4 1

Index Scan using md_srv_rendered_case_id_idx on public.md_srv_rendered msre (cost=0.57..57.38 rows=901 width=4) (actual time=0.033..0.037 rows=4 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.024 0.024 ↓ 0.0 0 4

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.006..0.006 rows=0 loops=4)

  • 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=13
440. 0.022 0.022 ↑ 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.022..0.022 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.90 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.075 0.075 ↓ 1.9 43 1

Seq Scan on motherhood.mh_pregnant_map pm_1 (cost=0.00..3.73 rows=23 width=4) (actual time=0.022..0.075 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: 9
  • Buffers: shared hit=2
443. 0.012 0.030 ↑ 1.0 1 1

Nested Loop (cost=1,645.05..1,653.09 rows=1 width=115) (actual time=0.030..0.030 rows=1 loops=1)

  • Output: row_to_json(ROW(sr_service_3.id, sr_service_3.name))
  • Buffers: shared hit=4
444. 0.006 0.007 ↑ 1.0 1 1

HashAggregate (cost=1,644.63..1,644.64 rows=1 width=4) (actual time=0.007..0.007 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.001 0.001 ↑ 1.0 1 1

Result (cost=1,644.60..1,644.62 rows=1 width=0) (actual time=0.001..0.001 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=444.79..444.80 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=436.77..444.78 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=436.77..436.77 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..185.21 rows=11,443 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..251.31 rows=13,165 width=0) (never executed)

  • Index Cond: (srg_13.responsible_id = 78020)
452. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=460.30..460.31 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=436.77..444.78 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=436.77..436.77 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..185.21 rows=11,443 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..251.31 rows=13,165 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..15.51 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=445.21..460.30 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=436.77..444.78 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=436.77..436.77 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..185.21 rows=11,443 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..251.31 rows=13,165 width=0) (never executed)

  • Index Cond: (srg_15.responsible_id = 78020)
465. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.58..279.19 rows=1 width=112) (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..278.74 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..267.81 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..10.91 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=116) (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.011 0.011 ↑ 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=115) (actual time=0.011..0.011 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.036 0.070 ↑ 1.0 1 1

Result (cost=2.12..2.13 rows=1 width=0) (actual time=0.070..0.070 rows=1 loops=1)

  • Output: ($175 <@ $177)
  • Buffers: shared hit=2
473.          

Initplan (for Result)

474. 0.023 0.023 ↓ 2.0 8 1

Seq Scan on public.evaluation_patient_condition_criteria_directory (cost=0.00..1.04 rows=4 width=4) (actual time=0.023..0.023 rows=8 loops=1)

  • Output: evaluation_patient_condition_criteria_directory.id
  • Buffers: shared hit=1
475. 0.011 0.011 ↓ 0.0 0 1

Seq Scan on public.evaluation_patient_condition_criteria_value epccv (cost=0.00..1.07 rows=1 width=4) (actual time=0.011..0.011 rows=0 loops=1)

  • Output: epccv.criteria_id
  • Filter: (epccv.step_id = ms.id)
  • Rows Removed by Filter: 15
  • Buffers: shared hit=1
476. 0.025 0.137 ↑ 1.0 1 1

Aggregate (cost=100.77..100.79 rows=1 width=4) (actual time=0.136..0.137 rows=1 loops=1)

  • Output: array_to_json(array_agg(row_to_json(ROW(res.id))))
  • Buffers: shared hit=10
477. 0.011 0.112 ↑ 16.0 1 1

Nested Loop (cost=2.23..100.69 rows=16 width=4) (actual time=0.110..0.112 rows=1 loops=1)

  • Output: res.id
  • Buffers: shared hit=10
478. 0.020 0.069 ↑ 17.0 1 1

Hash Join (cost=1.94..28.44 rows=17 width=4) (actual time=0.068..0.069 rows=1 loops=1)

  • Output: sgr.resource_id
  • Hash Cond: (sgr.role_id = rrol.id)
  • Buffers: shared hit=6
479. 0.032 0.032 ↑ 119.0 2 1

Index Scan using sr_res_group_relationship__group_id_ix on public.sr_res_group_relationship sgr (cost=0.57..26.00 rows=238 width=8) (actual time=0.031..0.032 rows=2 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.005 0.017 ↑ 1.0 2 1

Hash (cost=1.35..1.35 rows=2 width=4) (actual time=0.017..0.017 rows=2 loops=1)

  • Output: rrol.id
  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
  • Buffers: shared hit=1
481. 0.012 0.012 ↑ 1.0 2 1

Seq Scan on public.sr_res_role rrol (cost=0.00..1.35 rows=2 width=4) (actual time=0.007..0.012 rows=2 loops=1)

  • Output: rrol.id
  • Filter: ((rrol.code)::text = 'NURSE'::text)
  • Rows Removed by Filter: 26
  • Buffers: shared hit=1
482. 0.032 0.032 ↑ 1.0 1 1

Index Only Scan using sr_resource_pk on public.sr_resource res (cost=0.29..4.24 rows=1 width=4) (actual time=0.032..0.032 rows=1 loops=1)

  • Output: res.id
  • Index Cond: (res.id = sgr.resource_id)
  • Heap Fetches: 1
  • Buffers: shared hit=4
483. 0.001 0.027 ↓ 0.0 0 1

Nested Loop (cost=6.75..25.69 rows=1 width=4) (actual time=0.027..0.027 rows=0 loops=1)

  • Output: zrd.id
  • Buffers: shared hit=1
484. 0.001 0.026 ↓ 0.0 0 1

Nested Loop (cost=6.47..21.97 rows=1 width=8) (actual time=0.026..0.026 rows=0 loops=1)

  • Output: zrd.id, zrd.mkb_id
  • Buffers: shared hit=1
485. 0.005 0.025 ↓ 0.0 0 1

Nested Loop (cost=6.47..20.93 rows=1 width=12) (actual time=0.025..0.025 rows=0 loops=1)

  • Output: zrd.id, zrd.mkb_id, r_2.kind_id
  • Buffers: shared hit=1
486. 0.003 0.020 ↓ 0.0 0 1

Nested Loop (cost=4.31..13.40 rows=1 width=8) (actual time=0.020..0.020 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.013 0.013 ↑ 1.0 1 1

Seq Scan on d_accounting.register r_2 (cost=0.00..1.26 rows=1 width=8) (actual time=0.008..0.013 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: 24
  • Buffers: shared hit=1
488. 0.003 0.004 ↓ 0.0 0 1

Bitmap Heap Scan on d_accounting.account a (cost=4.31..12.11 rows=2 width=8) (actual time=0.004..0.004 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.001 0.001 ↓ 0.0 0 1

Bitmap Index Scan on account_patient_id_ix (cost=0.00..4.30 rows=2 width=0) (actual time=0.001..0.001 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.001 0.034 ↑ 1.0 1 1

Limit (cost=1.14..9.79 rows=1 width=4) (actual time=0.034..0.034 rows=1 loops=1)

  • Output: sr_srv_rendered.bdate
  • Buffers: shared hit=10
495. 0.005 0.033 ↑ 876.0 1 1

Nested Loop (cost=1.14..7,580.23 rows=876 width=4) (actual time=0.033..0.033 rows=1 loops=1)

  • Output: sr_srv_rendered.bdate
  • Buffers: shared hit=10
496. 0.019 0.019 ↑ 876.0 1 1

Index Scan using md_srv_rendered_step_id_idx on public.md_srv_rendered (cost=0.57..55.01 rows=876 width=4) (actual time=0.019..0.019 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.009 0.009 ↑ 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.009..0.009 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.014 0.024 ↑ 1.0 1 1

Nested Loop (cost=1,645.05..1,653.09 rows=1 width=115) (actual time=0.023..0.024 rows=1 loops=1)

  • Output: row_to_json(ROW(sr_service_4.id, sr_service_4.name))
  • Buffers: shared hit=4
499. 0.004 0.005 ↑ 1.0 1 1

HashAggregate (cost=1,644.63..1,644.64 rows=1 width=4) (actual time=0.005..0.005 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.001 0.001 ↑ 1.0 1 1

Result (cost=1,644.60..1,644.62 rows=1 width=0) (actual time=0.001..0.001 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=444.79..444.80 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=436.77..444.78 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=436.77..436.77 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..185.21 rows=11,443 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..251.31 rows=13,165 width=0) (never executed)

  • Index Cond: (srg_16.responsible_id = 78020)
507. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=460.30..460.31 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=436.77..444.78 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=436.77..436.77 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..185.21 rows=11,443 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..251.31 rows=13,165 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..15.51 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=445.21..460.30 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=436.77..444.78 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=436.77..436.77 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..185.21 rows=11,443 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..251.31 rows=13,165 width=0) (never executed)

  • Index Cond: (srg_18.responsible_id = 78020)
520. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.58..279.19 rows=1 width=112) (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..278.74 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..267.81 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..10.91 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=116) (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.005 0.005 ↑ 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=115) (actual time=0.005..0.005 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.011 0.020 ↑ 1.0 1 1

Nested Loop (cost=1,645.05..1,653.09 rows=1 width=115) (actual time=0.020..0.020 rows=1 loops=1)

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

HashAggregate (cost=1,644.63..1,644.64 rows=1 width=4) (actual time=0.006..0.006 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.001 0.001 ↑ 1.0 1 1

Result (cost=1,644.60..1,644.62 rows=1 width=0) (actual time=0.001..0.001 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=444.79..444.80 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=436.77..444.78 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=436.77..436.77 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..185.21 rows=11,443 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..251.31 rows=13,165 width=0) (never executed)

  • Index Cond: (srg_19.responsible_id = 78020)
536. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=460.30..460.31 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=436.77..444.78 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=436.77..436.77 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..185.21 rows=11,443 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..251.31 rows=13,165 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..15.51 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=445.21..460.30 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=436.77..444.78 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=436.77..436.77 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..185.21 rows=11,443 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..251.31 rows=13,165 width=0) (never executed)

  • Index Cond: (srg_21.responsible_id = 78020)
549. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.58..279.19 rows=1 width=112) (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..278.74 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..267.81 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..10.91 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=116) (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.003 0.003 ↑ 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=115) (actual time=0.003..0.003 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 : 106.496 ms
Execution time : 58.003 ms