explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 0va1

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 50.484 ↓ 0.0 0 1

Limit (cost=48,716.55..48,779.41 rows=1 width=1,066) (actual time=50.484..50.484 rows=0 loops=1)

  • Output: s._clinic_id, hr.id, c.uid, ((SubPlan 1)), p.id, ((((COALESCE(pi.surname, ''::character varying))::text || COALESCE((' '::text || (pi.name)::text), ''::text)) || COALESCE((' '::text || (pi.patr_name)::text), ''::text))), (COALESCE((('№'::text || (c.uid)::text) || ','::text), ''::text)), (date_part('year'::text, age(now(), (pi.birth_dt)::timestamp with time zone))), csg_t.name, ((((COALESCE(ei.surname, ''::character varying))::text || COALESCE(((' '::text || "substring"((ei.name)::text, 1, 1)) || '.'::text), ''::text)) || COALESCE(((' '::text || "substring"((ei.patr_name)::text, 1, 1)) || '.'::text), ''::text))), s.regimen_id, dp.name, dp.id, ((s.admission_date + COALESCE(s.admission_time, '00:00:00'::time without time zone))), s.admission_date, s.admission_time, (CASE WHEN (dp.type_id = 5) THEN (s.admission_date + COALESCE(s.admission_time, '00:00:00'::time without time zone)) ELSE NULL::timestamp without time zone END), (CASE WHEN (dp.type_id = 5) THEN 'text-error'::text ELSE ''::text END), ((SubPlan 2)), fst.name, fst.id, ((((dg.code)::text || ' '::text) || (dg.name)::text)), hr.issue_planned_date, s.outcome_date, rg.responsible_id, (((c.closing_step_id IS NULL) OR ((c.closing_step_id IS NOT NULL) AND (s.outcome_date > ('now'::cstring)::date)))), ((c.closing_step_id IS NOT NULL)), dp.type_id, c.id, hr.id, hr.department_id, s._clinic_id, c.patient_id, c.id, ((SubPlan 3)), hr.funding_id, ((SubPlan 4)), '15047', ((SubPlan 5))
  • Buffers: shared hit=191 read=10
  • I/O Timings: read=31.973
2.          

Initplan (for Limit)

3. 0.000 0.000 ↓ 0.0 0

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

  • Output: pim_department.is_social_significant
  • Index Cond: (pim_department.id = 15047)
4. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=8.86..34.65 rows=1 width=0) (never executed)

  • Hash Cond: (sre.method_id = cm.id)
5. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.56..25.90 rows=115 width=4) (never executed)

  • Output: sre.method_id
6. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.28..9.77 rows=1 width=8) (never executed)

  • Output: sur.role_id, sr.id
  • Join Filter: (sur.role_id = sr.id)
7. 0.000 0.000 ↓ 0.0 0

Index Only Scan using ak_userrole on public.sec_user_role sur (cost=0.28..8.30 rows=1 width=4) (never executed)

  • Output: sur.user_id, sur.role_id
  • Index Cond: (sur.user_id = 2837)
  • Heap Fetches: 0
8. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.sec_role sr (cost=0.00..1.21 rows=21 width=4) (never executed)

  • Output: sr.id, sr.version, sr.name, sr.note, sr.aud_who, sr.aud_when, sr.aud_source, sr.aud_who_create, sr.aud_when_create, sr.aud_source_create
9. 0.000 0.000 ↓ 0.0 0

Index Scan using sec_role_element_role_fk on public.sec_role_element sre (cost=0.28..14.92 rows=121 width=8) (never executed)

  • Output: sre.id, sre.obj_group_id, sre.property_id, sre.role_id, sre.method_id, sre.aud_who, sre.aud_when, sre.aud_source, sre.aud_who_create, sre.aud_when_create, sre.aud_source_create
  • Index Cond: (sre.role_id = sr.id)
10. 0.000 0.000 ↓ 0.0 0

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

  • Output: cm.id
11. 0.000 0.000 ↓ 0.0 0

Index Scan using sec_class_method_code_ak on public.sec_class_method cm (cost=0.27..8.29 rows=1 width=4) (never executed)

  • Output: cm.id
  • Index Cond: ((cm.code)::text = 'SocialSignificant.NarcologicProfile'::text)
12. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=8.86..34.65 rows=1 width=0) (never executed)

  • Hash Cond: (sre_1.method_id = cm_1.id)
13. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.56..25.90 rows=115 width=4) (never executed)

  • Output: sre_1.method_id
14. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.28..9.77 rows=1 width=8) (never executed)

  • Output: sur_1.role_id, sr_1.id
  • Join Filter: (sur_1.role_id = sr_1.id)
15. 0.000 0.000 ↓ 0.0 0

Index Only Scan using ak_userrole on public.sec_user_role sur_1 (cost=0.28..8.30 rows=1 width=4) (never executed)

  • Output: sur_1.user_id, sur_1.role_id
  • Index Cond: (sur_1.user_id = 2837)
  • Heap Fetches: 0
16. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.sec_role sr_1 (cost=0.00..1.21 rows=21 width=4) (never executed)

  • Output: sr_1.id, sr_1.version, sr_1.name, sr_1.note, 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
17. 0.000 0.000 ↓ 0.0 0

Index Scan using sec_role_element_role_fk on public.sec_role_element sre_1 (cost=0.28..14.92 rows=121 width=8) (never executed)

  • Output: sre_1.id, sre_1.obj_group_id, sre_1.property_id, sre_1.role_id, sre_1.method_id, sre_1.aud_who, sre_1.aud_when, sre_1.aud_source, sre_1.aud_who_create, sre_1.aud_when_create, sre_1.aud_source_create
  • Index Cond: (sre_1.role_id = sr_1.id)
18. 0.000 0.000 ↓ 0.0 0

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

  • Output: cm_1.id
19. 0.000 0.000 ↓ 0.0 0

Index Scan using sec_class_method_code_ak on public.sec_class_method cm_1 (cost=0.27..8.29 rows=1 width=4) (never executed)

  • Output: cm_1.id
  • Index Cond: ((cm_1.code)::text = 'SocialSignificant.PsychiatricProfile'::text)
20. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=8.86..34.65 rows=1 width=0) (never executed)

  • Hash Cond: (sre_2.method_id = cm_2.id)
21. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.56..25.90 rows=115 width=4) (never executed)

  • Output: sre_2.method_id
22. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.28..9.77 rows=1 width=8) (never executed)

  • Output: sur_2.role_id, sr_2.id
  • Join Filter: (sur_2.role_id = sr_2.id)
23. 0.000 0.000 ↓ 0.0 0

Index Only Scan using ak_userrole on public.sec_user_role sur_2 (cost=0.28..8.30 rows=1 width=4) (never executed)

  • Output: sur_2.user_id, sur_2.role_id
  • Index Cond: (sur_2.user_id = 2837)
  • Heap Fetches: 0
24. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.sec_role sr_2 (cost=0.00..1.21 rows=21 width=4) (never executed)

  • Output: sr_2.id, sr_2.version, sr_2.name, sr_2.note, sr_2.aud_who, sr_2.aud_when, sr_2.aud_source, sr_2.aud_who_create, sr_2.aud_when_create, sr_2.aud_source_create
25. 0.000 0.000 ↓ 0.0 0

Index Scan using sec_role_element_role_fk on public.sec_role_element sre_2 (cost=0.28..14.92 rows=121 width=8) (never executed)

  • Output: sre_2.id, sre_2.obj_group_id, sre_2.property_id, sre_2.role_id, sre_2.method_id, sre_2.aud_who, sre_2.aud_when, sre_2.aud_source, sre_2.aud_who_create, sre_2.aud_when_create, sre_2.aud_source_create
  • Index Cond: (sre_2.role_id = sr_2.id)
26. 0.000 0.000 ↓ 0.0 0

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

  • Output: cm_2.id
27. 0.000 0.000 ↓ 0.0 0

Index Scan using sec_class_method_code_ak on public.sec_class_method cm_2 (cost=0.27..8.29 rows=1 width=4) (never executed)

  • Output: cm_2.id
  • Index Cond: ((cm_2.code)::text = 'SocialSignificant.VenereologicalProfile'::text)
28. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=8.86..34.65 rows=1 width=0) (never executed)

  • Hash Cond: (sre_3.method_id = cm_3.id)
29. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.56..25.90 rows=115 width=4) (never executed)

  • Output: sre_3.method_id
30. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.28..9.77 rows=1 width=8) (never executed)

  • Output: sur_3.role_id, sr_3.id
  • Join Filter: (sur_3.role_id = sr_3.id)
31. 0.000 0.000 ↓ 0.0 0

Index Only Scan using ak_userrole on public.sec_user_role sur_3 (cost=0.28..8.30 rows=1 width=4) (never executed)

  • Output: sur_3.user_id, sur_3.role_id
  • Index Cond: (sur_3.user_id = 2837)
  • Heap Fetches: 0
32. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.sec_role sr_3 (cost=0.00..1.21 rows=21 width=4) (never executed)

  • Output: sr_3.id, sr_3.version, sr_3.name, sr_3.note, sr_3.aud_who, sr_3.aud_when, sr_3.aud_source, sr_3.aud_who_create, sr_3.aud_when_create, sr_3.aud_source_create
33. 0.000 0.000 ↓ 0.0 0

Index Scan using sec_role_element_role_fk on public.sec_role_element sre_3 (cost=0.28..14.92 rows=121 width=8) (never executed)

  • Output: sre_3.id, sre_3.obj_group_id, sre_3.property_id, sre_3.role_id, sre_3.method_id, sre_3.aud_who, sre_3.aud_when, sre_3.aud_source, sre_3.aud_who_create, sre_3.aud_when_create, sre_3.aud_source_create
  • Index Cond: (sre_3.role_id = sr_3.id)
34. 0.000 0.000 ↓ 0.0 0

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

  • Output: cm_3.id
35. 0.000 0.000 ↓ 0.0 0

Index Scan using sec_class_method_code_ak on public.sec_class_method cm_3 (cost=0.27..8.29 rows=1 width=4) (never executed)

  • Output: cm_3.id
  • Index Cond: ((cm_3.code)::text = 'SocialSignificant.TBProfile'::text)
36. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=8.86..34.65 rows=1 width=0) (never executed)

  • Hash Cond: (sre_4.method_id = cm_4.id)
37. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.56..25.90 rows=115 width=4) (never executed)

  • Output: sre_4.method_id
38. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.28..9.77 rows=1 width=8) (never executed)

  • Output: sur_4.role_id, sr_4.id
  • Join Filter: (sur_4.role_id = sr_4.id)
39. 0.000 0.000 ↓ 0.0 0

Index Only Scan using ak_userrole on public.sec_user_role sur_4 (cost=0.28..8.30 rows=1 width=4) (never executed)

  • Output: sur_4.user_id, sur_4.role_id
  • Index Cond: (sur_4.user_id = 2837)
  • Heap Fetches: 0
40. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.sec_role sr_4 (cost=0.00..1.21 rows=21 width=4) (never executed)

  • Output: sr_4.id, sr_4.version, sr_4.name, sr_4.note, sr_4.aud_who, sr_4.aud_when, sr_4.aud_source, sr_4.aud_who_create, sr_4.aud_when_create, sr_4.aud_source_create
41. 0.000 0.000 ↓ 0.0 0

Index Scan using sec_role_element_role_fk on public.sec_role_element sre_4 (cost=0.28..14.92 rows=121 width=8) (never executed)

  • Output: sre_4.id, sre_4.obj_group_id, sre_4.property_id, sre_4.role_id, sre_4.method_id, sre_4.aud_who, sre_4.aud_when, sre_4.aud_source, sre_4.aud_who_create, sre_4.aud_when_create, sre_4.aud_source_create
  • Index Cond: (sre_4.role_id = sr_4.id)
42. 0.000 0.000 ↓ 0.0 0

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

  • Output: cm_4.id
43. 0.000 0.000 ↓ 0.0 0

Index Scan using sec_class_method_code_ak on public.sec_class_method cm_4 (cost=0.27..8.29 rows=1 width=4) (never executed)

  • Output: cm_4.id
  • Index Cond: ((cm_4.code)::text = 'SocialSignificant.HIVProfile'::text)
44. 0.002 50.481 ↓ 0.0 0 1

Result (cost=48,535.02..48,597.89 rows=1 width=1,066) (actual time=50.480..50.481 rows=0 loops=1)

  • Output: s._clinic_id, hr.id, c.uid, (SubPlan 1), p.id, ((((COALESCE(pi.surname, ''::character varying))::text || COALESCE((' '::text || (pi.name)::text), ''::text)) || COALESCE((' '::text || (pi.patr_name)::text), ''::text))), (COALESCE((('№'::text || (c.uid)::text) || ','::text), ''::text)), (date_part('year'::text, age(now(), (pi.birth_dt)::timestamp with time zone))), csg_t.name, ((((COALESCE(ei.surname, ''::character varying))::text || COALESCE(((' '::text || "substring"((ei.name)::text, 1, 1)) || '.'::text), ''::text)) || COALESCE(((' '::text || "substring"((ei.patr_name)::text, 1, 1)) || '.'::text), ''::text))), s.regimen_id, dp.name, dp.id, ((s.admission_date + COALESCE(s.admission_time, '00:00:00'::time without time zone))), s.admission_date, s.admission_time, (CASE WHEN (dp.type_id = 5) THEN (s.admission_date + COALESCE(s.admission_time, '00:00:00'::time without time zone)) ELSE NULL::timestamp without time zone END), (CASE WHEN (dp.type_id = 5) THEN 'text-error'::text ELSE ''::text END), (SubPlan 2), fst.name, fst.id, ((((dg.code)::text || ' '::text) || (dg.name)::text)), hr.issue_planned_date, s.outcome_date, rg.responsible_id, (((c.closing_step_id IS NULL) OR ((c.closing_step_id IS NOT NULL) AND (s.outcome_date > ('now'::cstring)::date)))), ((c.closing_step_id IS NOT NULL)), dp.type_id, c.id, hr.id, hr.department_id, s._clinic_id, c.patient_id, c.id, (SubPlan 3), hr.funding_id, (SubPlan 4), '15047', (SubPlan 5)
  • Buffers: shared hit=191 read=10
  • I/O Timings: read=31.973
45. 0.029 50.479 ↓ 0.0 0 1

Sort (cost=48,535.02..48,535.03 rows=1 width=513) (actual time=50.479..50.479 rows=0 loops=1)

  • Output: s._clinic_id, hr.id, c.uid, p.id, ((((COALESCE(pi.surname, ''::character varying))::text || COALESCE((' '::text || (pi.name)::text), ''::text)) || COALESCE((' '::text || (pi.patr_name)::text), ''::text))), (COALESCE((('№'::text || (c.uid)::text) || ','::text), ''::text)), (date_part('year'::text, age(now(), (pi.birth_dt)::timestamp with time zone))), csg_t.name, ((((COALESCE(ei.surname, ''::character varying))::text || COALESCE(((' '::text || "substring"((ei.name)::text, 1, 1)) || '.'::text), ''::text)) || COALESCE(((' '::text || "substring"((ei.patr_name)::text, 1, 1)) || '.'::text), ''::text))), s.regimen_id, dp.name, dp.id, ((s.admission_date + COALESCE(s.admission_time, '00:00:00'::time without time zone))), s.admission_date, s.admission_time, (CASE WHEN (dp.type_id = 5) THEN (s.admission_date + COALESCE(s.admission_time, '00:00:00'::time without time zone)) ELSE NULL::timestamp without time zone END), (CASE WHEN (dp.type_id = 5) THEN 'text-error'::text ELSE ''::text END), fst.name, fst.id, ((((dg.code)::text || ' '::text) || (dg.name)::text)), hr.issue_planned_date, s.outcome_date, rg.responsible_id, (((c.closing_step_id IS NULL) OR ((c.closing_step_id IS NOT NULL) AND (s.outcome_date > ('now'::cstring)::date)))), ((c.closing_step_id IS NOT NULL)), dp.type_id, c.id, hr.id, hr.department_id, s._clinic_id, c.patient_id, c.id, hr.funding_id, '15047', s.res_group_id
  • Sort Key: dp.name, ((s.admission_date + COALESCE(s.admission_time, '00:00:00'::time without time zone))) DESC, ((((COALESCE(pi.surname, ''::character varying))::text || COALESCE((' '::text || (pi.name)::text), ''::text)) || COALESCE((' '::text || (pi.patr_name)::text), ''::text)))
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=191 read=10
  • I/O Timings: read=31.973
46. 0.028 50.450 ↓ 0.0 0 1

Result (cost=443.53..48,535.01 rows=1 width=513) (actual time=50.450..50.450 rows=0 loops=1)

  • Output: s._clinic_id, hr.id, c.uid, p.id, ((((COALESCE(pi.surname, ''::character varying))::text || COALESCE((' '::text || (pi.name)::text), ''::text)) || COALESCE((' '::text || (pi.patr_name)::text), ''::text))), (COALESCE((('№'::text || (c.uid)::text) || ','::text), ''::text)), (date_part('year'::text, age(now(), (pi.birth_dt)::timestamp with time zone))), csg_t.name, ((((COALESCE(ei.surname, ''::character varying))::text || COALESCE(((' '::text || "substring"((ei.name)::text, 1, 1)) || '.'::text), ''::text)) || COALESCE(((' '::text || "substring"((ei.patr_name)::text, 1, 1)) || '.'::text), ''::text))), s.regimen_id, dp.name, dp.id, ((s.admission_date + COALESCE(s.admission_time, '00:00:00'::time without time zone))), s.admission_date, s.admission_time, (CASE WHEN (dp.type_id = 5) THEN (s.admission_date + COALESCE(s.admission_time, '00:00:00'::time without time zone)) ELSE NULL::timestamp without time zone END), (CASE WHEN (dp.type_id = 5) THEN 'text-error'::text ELSE ''::text END), fst.name, fst.id, ((((dg.code)::text || ' '::text) || (dg.name)::text)), hr.issue_planned_date, s.outcome_date, rg.responsible_id, (((c.closing_step_id IS NULL) OR ((c.closing_step_id IS NOT NULL) AND (s.outcome_date > ('now'::cstring)::date)))), ((c.closing_step_id IS NOT NULL)), dp.type_id, c.id, hr.id, hr.department_id, s._clinic_id, c.patient_id, c.id, hr.funding_id, '15047', s.res_group_id
  • One-Time Filter: ((length(concat(NULL::date, NULL::date)) <> 0) OR (length(concat('2019-11-25'::date, '2019-11-26'::date)) <> 0))
  • Buffers: shared hit=191 read=10
  • I/O Timings: read=31.973
47. 0.002 50.422 ↓ 0.0 0 1

Nested Loop Anti Join (cost=443.53..48,535.01 rows=1 width=513) (actual time=50.422..50.422 rows=0 loops=1)

  • Output: s._clinic_id, hr.id, c.uid, p.id, (((COALESCE(pi.surname, ''::character varying))::text || COALESCE((' '::text || (pi.name)::text), ''::text)) || COALESCE((' '::text || (pi.patr_name)::text), ''::text)), COALESCE((('№'::text || (c.uid)::text) || ','::text), ''::text), date_part('year'::text, age(now(), (pi.birth_dt)::timestamp with time zone)), csg_t.name, (((COALESCE(ei.surname, ''::character varying))::text || COALESCE(((' '::text || "substring"((ei.name)::text, 1, 1)) || '.'::text), ''::text)) || COALESCE(((' '::text || "substring"((ei.patr_name)::text, 1, 1)) || '.'::text), ''::text)), s.regimen_id, dp.name, dp.id, (s.admission_date + COALESCE(s.admission_time, '00:00:00'::time without time zone)), s.admission_date, s.admission_time, CASE WHEN (dp.type_id = 5) THEN (s.admission_date + COALESCE(s.admission_time, '00:00:00'::time without time zone)) ELSE NULL::timestamp without time zone END, CASE WHEN (dp.type_id = 5) THEN 'text-error'::text ELSE ''::text END, fst.name, fst.id, (((dg.code)::text || ' '::text) || (dg.name)::text), hr.issue_planned_date, s.outcome_date, rg.responsible_id, ((c.closing_step_id IS NULL) OR ((c.closing_step_id IS NOT NULL) AND (s.outcome_date > ('now'::cstring)::date))), (c.closing_step_id IS NOT NULL), dp.type_id, c.id, hr.id, hr.department_id, s._clinic_id, c.patient_id, c.id, hr.funding_id, '15047', s.res_group_id
  • Join Filter: (s2.case_id = c.id)
  • Buffers: shared hit=191 read=10
  • I/O Timings: read=31.973
48. 0.001 50.420 ↓ 0.0 0 1

Nested Loop Left Join (cost=442.65..48,511.79 rows=1 width=467) (actual time=50.420..50.420 rows=0 loops=1)

  • Output: hr.id, hr.issue_planned_date, hr.department_id, hr.funding_id, s._clinic_id, s.res_group_id, s.regimen_id, s.admission_date, s.admission_time, s.outcome_date, rg.responsible_id, csg_t.name, c.uid, c.id, c.closing_step_id, c.patient_id, p.id, pi.surname, pi.name, pi.patr_name, pi.birth_dt, dp.name, dp.id, dp.type_id, fst.name, fst.id, dg.code, dg.name, ei.surname, ei.name, ei.patr_name
  • Buffers: shared hit=191 read=10
  • I/O Timings: read=31.973
49. 0.002 50.419 ↓ 0.0 0 1

Nested Loop Left Join (cost=442.23..48,504.88 rows=1 width=423) (actual time=50.419..50.419 rows=0 loops=1)

  • Output: hr.id, hr.issue_planned_date, hr.department_id, hr.funding_id, s._clinic_id, s.res_group_id, s.regimen_id, s.admission_date, s.admission_time, s.outcome_date, rg.responsible_id, csg_t.name, c.uid, c.id, c.closing_step_id, c.patient_id, p.id, pi.surname, pi.name, pi.patr_name, pi.birth_dt, dp.name, dp.id, dp.type_id, fst.name, fst.id, dg.code, dg.name, e.individual_id
  • Buffers: shared hit=191 read=10
  • I/O Timings: read=31.973
50. 0.001 50.417 ↓ 0.0 0 1

Nested Loop Left Join (cost=441.94..48,499.17 rows=1 width=423) (actual time=50.417..50.417 rows=0 loops=1)

  • Output: hr.id, hr.issue_planned_date, hr.department_id, hr.funding_id, s._clinic_id, s.res_group_id, s.regimen_id, s.admission_date, s.admission_time, s.outcome_date, rg.responsible_id, csg_t.name, c.uid, c.id, c.closing_step_id, c.patient_id, p.id, pi.surname, pi.name, pi.patr_name, pi.birth_dt, dp.name, dp.id, dp.type_id, fst.name, fst.id, dg.code, dg.name, ep.employee_id
  • Buffers: shared hit=191 read=10
  • I/O Timings: read=31.973
51. 0.001 50.416 ↓ 0.0 0 1

Nested Loop Left Join (cost=441.65..48,493.45 rows=1 width=419) (actual time=50.416..50.416 rows=0 loops=1)

  • Output: hr.id, hr.issue_planned_date, hr.department_id, hr.funding_id, s._clinic_id, s.res_group_id, s.regimen_id, s.admission_date, s.admission_time, s.outcome_date, rg.responsible_id, csg_t.name, c.uid, c.id, c.closing_step_id, c.patient_id, p.id, pi.surname, pi.name, pi.patr_name, pi.birth_dt, dp.name, dp.id, dp.type_id, fst.name, fst.id, dg.code, dg.name
  • Buffers: shared hit=191 read=10
  • I/O Timings: read=31.973
52. 0.001 50.415 ↓ 0.0 0 1

Nested Loop Left Join (cost=441.37..48,487.69 rows=1 width=343) (actual time=50.415..50.415 rows=0 loops=1)

  • Output: hr.id, hr.issue_planned_date, hr.department_id, hr.funding_id, s._clinic_id, s.res_group_id, s.regimen_id, s.admission_date, s.admission_time, s.outcome_date, rg.responsible_id, csg_t.name, c.uid, c.id, c.closing_step_id, c.patient_id, p.id, pi.surname, pi.name, pi.patr_name, pi.birth_dt, dp.name, dp.id, dp.type_id, fst.name, fst.id, mcdiag.diagnos_id
  • Buffers: shared hit=191 read=10
  • I/O Timings: read=31.973
53. 0.001 50.414 ↓ 0.0 0 1

Nested Loop Left Join (cost=440.93..48,480.50 rows=1 width=343) (actual time=50.414..50.414 rows=0 loops=1)

  • Output: hr.id, hr.issue_planned_date, hr.department_id, hr.funding_id, s._clinic_id, s.res_group_id, s.regimen_id, s.admission_date, s.admission_time, s.outcome_date, s.main_diagnosis_id, rg.responsible_id, csg_t.name, c.uid, c.id, c.closing_step_id, c.patient_id, p.id, pi.surname, pi.name, pi.patr_name, pi.birth_dt, dp.name, dp.id, dp.type_id, fst.name, fst.id
  • Join Filter: (fst.id = hr.funding_id)
  • Buffers: shared hit=191 read=10
  • I/O Timings: read=31.973
54. 0.000 50.413 ↓ 0.0 0 1

Nested Loop (cost=440.93..48,479.30 rows=1 width=312) (actual time=50.413..50.413 rows=0 loops=1)

  • Output: hr.id, hr.issue_planned_date, hr.department_id, hr.funding_id, s._clinic_id, s.res_group_id, s.regimen_id, s.admission_date, s.admission_time, s.outcome_date, s.main_diagnosis_id, rg.responsible_id, csg_t.name, c.uid, c.id, c.closing_step_id, c.patient_id, p.id, pi.surname, pi.name, pi.patr_name, pi.birth_dt, dp.name, dp.id, dp.type_id
  • Join Filter: (hr.department_id = dp.id)
  • Buffers: shared hit=191 read=10
  • I/O Timings: read=31.973
55. 0.002 50.413 ↓ 0.0 0 1

Nested Loop (cost=440.93..48,368.04 rows=1 width=243) (actual time=50.413..50.413 rows=0 loops=1)

  • Output: hr.id, hr.issue_planned_date, hr.department_id, hr.funding_id, s._clinic_id, s.res_group_id, s.regimen_id, s.admission_date, s.admission_time, s.outcome_date, s.main_diagnosis_id, rg.responsible_id, csg_t.name, c.uid, c.id, c.closing_step_id, c.patient_id, p.id, pi.surname, pi.name, pi.patr_name, pi.birth_dt
  • Buffers: shared hit=191 read=10
  • I/O Timings: read=31.973
56. 0.002 50.411 ↓ 0.0 0 1

Nested Loop (cost=440.50..48,362.11 rows=1 width=195) (actual time=50.411..50.411 rows=0 loops=1)

  • Output: hr.id, hr.issue_planned_date, hr.department_id, hr.funding_id, s._clinic_id, s.res_group_id, s.regimen_id, s.admission_date, s.admission_time, s.outcome_date, s._patient_id, s.main_diagnosis_id, rg.responsible_id, csg_t.name, c.uid, c.id, c.closing_step_id, c.patient_id, p.id
  • Buffers: shared hit=191 read=10
  • I/O Timings: read=31.973
57. 0.000 50.409 ↓ 0.0 0 1

Nested Loop Left Join (cost=440.07..48,358.90 rows=1 width=191) (actual time=50.409..50.409 rows=0 loops=1)

  • Output: hr.id, hr.issue_planned_date, hr.department_id, hr.funding_id, s._clinic_id, s.res_group_id, s.regimen_id, s.admission_date, s.admission_time, s.outcome_date, s._patient_id, s.main_diagnosis_id, rg.responsible_id, csg_t.name, c.uid, c.id, c.closing_step_id, c.patient_id
  • Join Filter: (csg_t.id = s.csg_id)
  • Buffers: shared hit=191 read=10
  • I/O Timings: read=31.973
58. 0.002 50.409 ↓ 0.0 0 1

Nested Loop Left Join (cost=440.07..48,135.15 rows=1 width=79) (actual time=50.408..50.409 rows=0 loops=1)

  • Output: hr.id, hr.issue_planned_date, hr.department_id, hr.funding_id, s._clinic_id, s.res_group_id, s.regimen_id, s.admission_date, s.admission_time, s.outcome_date, s.csg_id, s._patient_id, s.main_diagnosis_id, rg.responsible_id, c.uid, c.id, c.closing_step_id, c.patient_id
  • Buffers: shared hit=191 read=10
  • I/O Timings: read=31.973
59. 0.001 50.407 ↓ 0.0 0 1

Nested Loop (cost=439.51..48,127.73 rows=1 width=75) (actual time=50.407..50.407 rows=0 loops=1)

  • Output: hr.id, hr.issue_planned_date, hr.department_id, hr.funding_id, s._clinic_id, s.res_group_id, s.regimen_id, s.admission_date, s.admission_time, s.outcome_date, s.csg_id, s._patient_id, s.main_diagnosis_id, c.uid, c.id, c.closing_step_id, c.patient_id
  • Buffers: shared hit=191 read=10
  • I/O Timings: read=31.973
60. 0.037 50.406 ↓ 0.0 0 1

Nested Loop (cost=439.08..48,121.78 rows=1 width=63) (actual time=50.406..50.406 rows=0 loops=1)

  • Output: s._clinic_id, s.res_group_id, s.regimen_id, s.admission_date, s.admission_time, s.outcome_date, s.id, s.csg_id, s._patient_id, s.main_diagnosis_id, c.uid, c.id, c.closing_step_id, c.patient_id
  • Buffers: shared hit=191 read=10
  • I/O Timings: read=31.973
61. 0.304 18.206 ↑ 457.7 3 1

Bitmap Heap Scan on public.mc_case c (cost=438.64..5,749.27 rows=1,373 width=19) (actual time=18.083..18.206 rows=3 loops=1)

  • Output: c.id, c.create_date, c.emergency_team_code, c.note, c.plan_case_duration, c.plan_hosp_date, c.uid, c.who_delivered, c.who_delivered_code, c.who_delivered_team_number, c.admission_reason_id, c.admission_state_id, c.admission_type_id, c.care_level_id, c.case_type_id, c.clinic_id, c.main_contract_id, c.drunkenness_type_id, c.funding_id, c.init_goal_id, c.init_type_id, c.main_diagnos_id, c.result_id, c.patient_id, c.referral_id, c.care_regimen_id, c.repeat_count_id, c.soc_group_id, c.state_id, c.time_gone_id, c.transporting_type_id, c.referral_resulting_id, c.payment_method_id, c.complexity_level_id, c.deviation_reason_id, c.open_date, c.closing_step_id, c.provision_condition_id, c.care_providing_form_id, c.injury_type_id, c.hsp_canal_id, c.rankin_scale_for_admission_id, c.rankin_scale_on_disposal_id, c.notes_to_work, c.aud_who, c.aud_when, c.aud_source, c.aud_who_create, c.aud_when_create, c.aud_source_create, c.close_date, c.open_time, c.prehospital_stage_defect_id, c.mark, c.is_need_sicklist, c.narcotic_substance, c.where_from_delivered, c.vmp_appointment_number, c.death_reason_diagnosis_id, c.death_reason, c.external_reason_mkb_id, c.vmp_date, c.vmp_plan_date, c.pregnancy_date, c.is_social_significant, c.is_finance_type_control, c.is_control_case_init_goal, c.ticket_vmp, c.ticket_vmp_date, c.planned_hospitalization_date, c.severity_level_id, c.additional_data
  • Recheck Cond: ((c.uid)::text ~~ '%3441630%'::text)
  • Filter: ((c.is_social_significant IS NULL) OR (c.is_social_significant = $9) OR ((c.is_social_significant = 1) AND $11) OR ((c.is_social_significant = 2) AND $13) OR ((c.is_social_significant = 3) AND $15) OR ((c.is_social_significant = 4) AND $17) OR ((c.is_social_significant = 5) AND $19))
  • Heap Blocks: exact=3
  • Buffers: shared hit=186 read=3
  • I/O Timings: read=0.147
62. 17.902 17.902 ↑ 457.7 3 1

Bitmap Index Scan on mc_case_uid_gin_idx (cost=0.00..438.30 rows=1,373 width=0) (actual time=17.902..17.902 rows=3 loops=1)

  • Index Cond: ((c.uid)::text ~~ '%3441630%'::text)
  • Buffers: shared hit=186
63. 32.163 32.163 ↓ 0.0 0 3

Index Scan using idx_mc_step on public.mc_step s (cost=0.44..30.85 rows=1 width=48) (actual time=10.721..10.721 rows=0 loops=3)

  • Output: s.id, s.admission_date, s.admission_time, s.death_date, s.death_time, s.outcome_date, s.outcome_time, s.death_employee_id, s.main_diagnosis_id, s.case_id, s.outcome_id, s.outcome_clinic_id, s.outcome_regimen_id, s.regimen_id, s.res_group_id, s.result_id, s.reason_id, s.profile_id, s.mes_id, s.mes_quality_criterion_id, s.is_continue, s.is_continue_editable, s.standard_id, s.csg_id, s.vmp_type_id, s.vmp_method_id, s.deviation_reason_id, s.aud_who, s.aud_when, s.aud_source, s.aud_who_create, s.aud_when_create, s.aud_source_create, s._clinic_id, s._patient_id, s._case_mode_id, s._responsible_id, s._department_id, s.hsp_bed_days_amount, s.hsp_bed_profile_id, s.hsp_complexity_level_id, s.hsp_days_comp_algo_id, s.hsp_department_id, s.hsp_funding_id, s.hsp_is_admission_day_counts, s.hsp_is_diag_not_eq, s.hsp_is_set_diagnosis, s.hsp_issue_planned_date, s.hsp_mes_id, s.hsp_missed_days_amount, s.hsp_plan_department_id, s.hsp_previous_id, s.hsp_refusal_employee_id, s.plc_goal_id, s.plc_initiator_id, s.plc_is_needed, s.plc_is_sanitized, s.plc_is_viewed, s.plc_place_id, s.plc_type_id, s.plc_appointment_id, s.plc_planned_date, s._is_last, s.is_autopsy, s.planned_date_closing_case, s.gestational_age, s.onko_stage, s.is_first_step
  • Index Cond: (s.case_id = c.id)
  • Filter: ((s._clinic_id = 864881) AND ((c.closing_step_id IS NULL) OR ((c.closing_step_id IS NOT NULL) AND (s.outcome_date > ('now'::cstring)::date))))
  • Rows Removed by Filter: 2
  • Buffers: shared hit=5 read=7
  • I/O Timings: read=31.826
64. 0.000 0.000 ↓ 0.0 0

Index Scan using hsp_record_pk on public.hsp_record hr (cost=0.43..5.94 rows=1 width=16) (never executed)

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

Index Scan using sr_res_group_pk on public.sr_res_group rg (cost=0.56..7.41 rows=1 width=8) (never executed)

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

Seq Scan on public.md_clinical_statistical_group csg_t (cost=0.00..175.00 rows=3,900 width=120) (never executed)

  • Output: csg_t.name, csg_t.id
67. 0.000 0.000 ↓ 0.0 0

Index Only Scan using pci_patient_pk on public.pci_patient p (cost=0.43..3.19 rows=1 width=4) (never executed)

  • Output: p.id
  • Index Cond: (p.id = s._patient_id)
  • Heap Fetches: 0
68. 0.000 0.000 ↓ 0.0 0

Index Scan using pim_individual_pk on public.pim_individual pi (cost=0.42..5.92 rows=1 width=56) (never executed)

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

Seq Scan on public.pim_department dp (cost=0.00..81.42 rows=2,387 width=69) (never executed)

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

Seq Scan on public.fin_funding_source_type fst (cost=0.00..1.09 rows=9 width=31) (never executed)

  • Output: fst.id, fst.bdate, fst.code, fst.edate, fst.name, fst.ordern, fst.parent_id, fst.has_exception, fst.e_code, fst.is_contract_required, fst.is_citizen, fst.is_payer_smo, fst.is_payer_foms, fst.is_default, fst.is_privileged, fst.from_dt, fst.to_dt, fst.aud_who, fst.aud_when, fst.aud_source, fst.aud_who_create, fst.aud_when_create, fst.aud_source_create, fst.is_vmp, fst.billing_code
71. 0.000 0.000 ↓ 0.0 0

Index Scan using mc_diagnosis_pk on public.mc_diagnosis mcdiag (cost=0.44..7.18 rows=1 width=8) (never executed)

  • Output: mcdiag.id, mcdiag.diagnos_id
  • Index Cond: (mcdiag.id = s.main_diagnosis_id)
72. 0.000 0.000 ↓ 0.0 0

Index Scan using md_diagnosis_pk on public.md_diagnosis dg (cost=0.29..5.75 rows=1 width=84) (never executed)

  • Output: dg.id, dg.code, dg.name, dg.parent_id, dg.is_injury, dg.level, dg.is_leaf, dg.e_code, dg.from_dt, dg.to_dt, dg.oms, dg.stomat, dg.aud_who, dg.aud_when, dg.aud_source, dg.aud_who_create, dg.aud_when_create, dg.aud_source_create, dg.gender_id
  • Index Cond: (dg.id = mcdiag.diagnos_id)
73. 0.000 0.000 ↓ 0.0 0

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

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

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

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

Index Scan using pim_individual_pk on public.pim_individual ei (cost=0.42..6.90 rows=1 width=52) (never executed)

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

Nested Loop (cost=0.86..12.00 rows=1 width=8) (never executed)

  • Output: h2.previous_id, s2.case_id
77. 0.000 0.000 ↓ 0.0 0

Index Scan using fk_hsp_record_to_record on public.hsp_record h2 (cost=0.43..5.91 rows=1 width=8) (never executed)

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

Index Scan using mc_step_pk on public.mc_step s2 (cost=0.44..6.08 rows=1 width=8) (never executed)

  • Output: s2.id, s2.admission_date, s2.admission_time, s2.death_date, s2.death_time, s2.outcome_date, s2.outcome_time, s2.death_employee_id, s2.main_diagnosis_id, s2.case_id, s2.outcome_id, s2.outcome_clinic_id, s2.outcome_regimen_id, s2.regimen_id, s2.res_group_id, s2.result_id, s2.reason_id, s2.profile_id, s2.mes_id, s2.mes_quality_criterion_id, s2.is_continue, s2.is_continue_editable, s2.standard_id, s2.csg_id, s2.vmp_type_id, s2.vmp_method_id, s2.deviation_reason_id, s2.aud_who, s2.aud_when, s2.aud_source, s2.aud_who_create, s2.aud_when_create, s2.aud_source_create, s2._clinic_id, s2._patient_id, s2._case_mode_id, s2._responsible_id, s2._department_id, s2.hsp_bed_days_amount, s2.hsp_bed_profile_id, s2.hsp_complexity_level_id, s2.hsp_days_comp_algo_id, s2.hsp_department_id, s2.hsp_funding_id, s2.hsp_is_admission_day_counts, s2.hsp_is_diag_not_eq, s2.hsp_is_set_diagnosis, s2.hsp_issue_planned_date, s2.hsp_mes_id, s2.hsp_missed_days_amount, s2.hsp_plan_department_id, s2.hsp_previous_id, s2.hsp_refusal_employee_id, s2.plc_goal_id, s2.plc_initiator_id, s2.plc_is_needed, s2.plc_is_sanitized, s2.plc_is_viewed, s2.plc_place_id, s2.plc_type_id, s2.plc_appointment_id, s2.plc_planned_date, s2._is_last, s2.is_autopsy, s2.planned_date_closing_case, s2.gestational_age, s2.onko_stage, s2.is_first_step
  • Index Cond: (s2.id = h2.id)
79.          

SubPlan (for Result)

80. 0.000 0.000 ↓ 0.0 0

Limit (cost=39.78..39.78 rows=1 width=32) (never executed)

  • Output: ((((pim_room.name)::text || ', койка № '::text) || (md_bed.number)::text))
81. 0.000 0.000 ↓ 0.0 0

Sort (cost=39.78..39.79 rows=5 width=32) (never executed)

  • Output: ((((pim_room.name)::text || ', койка № '::text) || (md_bed.number)::text))
  • Sort Key: ((((pim_room.name)::text || ', койка № '::text) || (md_bed.number)::text))
82. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=27.49..39.75 rows=5 width=32) (never executed)

  • Output: (((pim_room.name)::text || ', койка № '::text) || (md_bed.number)::text)
83. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=27.21..37.77 rows=5 width=6) (never executed)

  • Output: md_bed.number, md_bed.room_id
84. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=26.94..35.81 rows=5 width=4) (never executed)

  • Output: md_bed_resource.bed_id
  • Hash Cond: (sr_res_group_relationship.resource_id = md_bed_resource.id)
85. 0.000 0.000 ↓ 0.0 0

Index Scan using sr_res_group_relationship__group_id_ix on public.sr_res_group_relationship (cost=0.56..9.32 rows=19 width=4) (never executed)

  • Output: sr_res_group_relationship.id, sr_res_group_relationship.bdatetime, sr_res_group_relationship.edatetime, sr_res_group_relationship.resource_id, sr_res_group_relationship.group_id, sr_res_group_relationship.role_id, sr_res_group_relationship.is_disabled, sr_res_group_relationship.aud_who, sr_res_group_relationship.aud_when, sr_res_group_relationship.aud_source, sr_res_group_relationship.aud_who_create, sr_res_group_relationship.aud_when_create, sr_res_group_relationship.aud_source_create, sr_res_group_relationship._is_system
  • Index Cond: (sr_res_group_relationship.group_id = s.res_group_id)
  • Filter: ((sr_res_group_relationship.is_disabled IS FALSE) OR (sr_res_group_relationship.is_disabled IS NULL))
86. 0.000 0.000 ↓ 0.0 0

Hash (cost=14.50..14.50 rows=950 width=8) (never executed)

  • Output: md_bed_resource.id, md_bed_resource.bed_id
87. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.md_bed_resource (cost=0.00..14.50 rows=950 width=8) (never executed)

  • Output: md_bed_resource.id, md_bed_resource.bed_id
88. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_md_bed on public.md_bed (cost=0.28..0.38 rows=1 width=10) (never executed)

  • Output: md_bed.id, md_bed.room_id, md_bed.profile_id, md_bed.regimen_id, md_bed.from_dt, md_bed.to_dt, md_bed.number, md_bed.bed_profile_id, md_bed.unit_id, md_bed.bed_profile_pass_id, md_bed.additional_bed, md_bed.aud_who, md_bed.aud_when, md_bed.aud_source, md_bed.aud_who_create, md_bed.aud_when_create, md_bed.aud_source_create, md_bed.age_group_id, md_bed.gender_id, md_bed.count_shift
  • Index Cond: (md_bed.id = md_bed_resource.bed_id)
89. 0.000 0.000 ↓ 0.0 0

Index Scan using pim_room_pk on public.pim_room (cost=0.28..0.38 rows=1 width=28) (never executed)

  • Output: pim_room.id, pim_room.code, pim_room.floor_area, pim_room.name, pim_room.cell_count, pim_room.cell_count_extra, pim_room.building_id, pim_room.department_id, pim_room.floor_id, pim_room.parent_room_id, pim_room.type_id, pim_room.comfort_level_id, pim_room.post_id, pim_room.regimen_id, pim_room.unit_id, pim_room.gender_id, pim_room.from_dt, pim_room.to_dt, pim_room.aud_who, pim_room.aud_when, pim_room.aud_source, pim_room.aud_who_create, pim_room.aud_when_create, pim_room.aud_source_create, pim_room.age_group_id, pim_room.contact
  • Index Cond: (pim_room.id = md_bed.room_id)
90. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..0.26 rows=1 width=4) (never executed)

  • Output: get_bed_day_amount_n2o(c.id)
91. 0.000 0.000 ↓ 0.0 0

Limit (cost=2.20..3.35 rows=1 width=8) (never executed)

  • Output: ffs.id, fspt1.funding_source_id
92. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=2.20..3.35 rows=1 width=8) (never executed)

  • Output: ffs.id, fspt1.funding_source_id
93. 0.000 0.000 ↓ 0.0 0

Merge Join (cost=2.20..2.23 rows=1 width=12) (never executed)

  • Output: ffs.id, fspt1.funding_source_id, fspt1.payment_type_id
  • Merge Cond: (ffs.id = fspt1.funding_source_id)
94. 0.000 0.000 ↓ 0.0 0

Sort (cost=1.11..1.12 rows=3 width=4) (never executed)

  • Output: ffs.id
  • Sort Key: ffs.id
95. 0.000 0.000 ↓ 0.0 0

Seq Scan on inventory.funding_source ffs (cost=0.00..1.09 rows=3 width=4) (never executed)

  • Output: ffs.id
  • Filter: ((ffs.org_id IS NULL) OR (ffs.org_id = s._clinic_id))
96. 0.000 0.000 ↓ 0.0 0

Sort (cost=1.08..1.09 rows=1 width=8) (never executed)

  • Output: fspt1.funding_source_id, fspt1.payment_type_id
  • Sort Key: fspt1.funding_source_id
97. 0.000 0.000 ↓ 0.0 0

Seq Scan on inventory.funding_source_payment_type fspt1 (cost=0.00..1.07 rows=1 width=8) (never executed)

  • Output: fspt1.funding_source_id, fspt1.payment_type_id
  • Filter: (fspt1.is_check_accounting AND ((fspt1.org_id IS NULL) OR (fspt1.org_id = s._clinic_id)) AND (fspt1.payment_type_id = hr.funding_id))
98. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.fin_funding_source_type ffst (cost=0.00..1.11 rows=1 width=4) (never executed)

  • 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.from_dt, ffst.to_dt, ffst.aud_who, ffst.aud_when, ffst.aud_source, ffst.aud_who_create, ffst.aud_when_create, ffst.aud_source_create, ffst.is_vmp, ffst.billing_code
  • Filter: (ffst.id = hr.funding_id)
99. 0.000 0.000 ↓ 0.0 0

Limit (cost=3.33..3.34 rows=1 width=15) (never executed)

  • Output: ffs_1.name, fspt1_1.funding_source_id
100. 0.000 0.000 ↓ 0.0 0

Sort (cost=3.33..3.34 rows=1 width=15) (never executed)

  • Output: ffs_1.name, fspt1_1.funding_source_id
  • Sort Key: fspt1_1.funding_source_id, ffs_1.name
101. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.00..3.32 rows=1 width=15) (never executed)

  • Output: ffs_1.name, fspt1_1.funding_source_id
102. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.00..2.20 rows=1 width=19) (never executed)

  • Output: ffs_1.name, fspt1_1.funding_source_id, fspt1_1.payment_type_id
  • Join Filter: (ffs_1.id = fspt1_1.funding_source_id)
103. 0.000 0.000 ↓ 0.0 0

Seq Scan on inventory.funding_source_payment_type fspt1_1 (cost=0.00..1.07 rows=1 width=8) (never executed)

  • Output: fspt1_1.id, fspt1_1.funding_source_id, fspt1_1.payment_type_id, fspt1_1.is_check_accounting, fspt1_1.is_check_not_accounting, fspt1_1.is_check_drug, fspt1_1.aud_who, fspt1_1.aud_when, fspt1_1.aud_source, fspt1_1.aud_who_create, fspt1_1.aud_when_create, fspt1_1.aud_source_create, fspt1_1.org_id
  • Filter: (fspt1_1.is_check_accounting AND ((fspt1_1.org_id IS NULL) OR (fspt1_1.org_id = s._clinic_id)) AND (fspt1_1.payment_type_id = hr.funding_id))
104. 0.000 0.000 ↓ 0.0 0

Seq Scan on inventory.funding_source ffs_1 (cost=0.00..1.09 rows=3 width=15) (never executed)

  • Output: ffs_1.id, ffs_1.code, ffs_1.name, ffs_1.aud_who, ffs_1.aud_when, ffs_1.aud_source, ffs_1.aud_who_create, ffs_1.aud_when_create, ffs_1.aud_source_create, ffs_1.org_id, ffs_1.parent_id
  • Filter: ((ffs_1.org_id IS NULL) OR (ffs_1.org_id = s._clinic_id))
105. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.fin_funding_source_type ffst_1 (cost=0.00..1.11 rows=1 width=4) (never executed)

  • Output: ffst_1.id, ffst_1.bdate, ffst_1.code, ffst_1.edate, ffst_1.name, ffst_1.ordern, ffst_1.parent_id, ffst_1.has_exception, ffst_1.e_code, ffst_1.is_contract_required, ffst_1.is_citizen, ffst_1.is_payer_smo, ffst_1.is_payer_foms, ffst_1.is_default, ffst_1.is_privileged, ffst_1.from_dt, ffst_1.to_dt, ffst_1.aud_who, ffst_1.aud_when, ffst_1.aud_source, ffst_1.aud_who_create, ffst_1.aud_when_create, ffst_1.aud_source_create, ffst_1.is_vmp, ffst_1.billing_code
  • Filter: (ffst_1.id = hr.funding_id)
106. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.72..16.05 rows=1 width=0) (never executed)

  • Join Filter: (o.id = oc.pregnant_outcome_id)
107. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=1.72..14.94 rows=1 width=4) (never executed)

  • Output: o.id
  • Hash Cond: (msr.id = o.service_id)
108. 0.000 0.000 ↓ 0.0 0

Index Scan using md_srv_rendered_case_fk on public.md_srv_rendered msr (cost=0.56..13.34 rows=115 width=4) (never executed)

  • 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.entity_sync_num, msr.complicated_value, msr.by_standard, msr.vmp_profile_id
  • Index Cond: (msr.case_id = c.id)
109. 0.000 0.000 ↓ 0.0 0

Hash (cost=1.07..1.07 rows=7 width=8) (never executed)

  • Output: o.id, o.service_id
110. 0.000 0.000 ↓ 0.0 0

Seq Scan on motherhood.mh_pregnant_outcome o (cost=0.00..1.07 rows=7 width=8) (never executed)

  • Output: o.id, o.service_id
111. 0.000 0.000 ↓ 0.0 0

Seq Scan on motherhood.mh_pregnant_outcome_child oc (cost=0.00..1.05 rows=5 width=4) (never executed)

  • Output: oc.id, oc.gender_id, oc.birth_dt, oc.outcome_id, oc.pregnant_outcome_id, oc.note, oc.weight, oc.height, oc.pulse_id, oc.breath_id, oc.muscle_tone_id, oc.reflexes_id, oc.skin_color_id, oc.patient_id, oc.aud_who, oc.aud_when, oc.aud_source, oc.aud_who_create, oc.aud_when_create, oc.aud_source_create, oc.full_term_id, oc.head, oc.chest
Planning time : 73.151 ms
Execution time : 52.882 ms