explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kX1Y

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 0.153 ↓ 0.0 0 1

Limit (cost=23,194,465.08..23,197,939.91 rows=1 width=445) (actual time=0.153..0.153 rows=0 loops=1)

  • Output: mesp.id, mesp.event_id, mesp.indiv_id, mep.id, mnds.code, ss.id, ss.name, po.id, (CASE mesp.status WHEN 4 THEN po.short_name WHEN 3 THEN (NULLIF(((SubPlan 1))::text, NULL::text))::character varying ELSE NULL::character varying END), srg.id, (CASE mesp.status WHEN 4 THEN srg.name WHEN 3 THEN (NULLIF(((SubPlan 2))::text, NULL::text))::character varying ELSE NULL::character varying END), mess.id, mess.name, (CASE mesp.status WHEN 4 THEN NULLIF((SubPlan 3), NULL::date) WHEN 3 THEN NULLIF((SubPlan 4), NULL::date) ELSE NULL::date END), (CASE mesp.status WHEN 2 THEN NULLIF((SubPlan 5), NULL::date) ELSE NULL::date END), mespa.agree, mes.order_idx, mes.first, mes.last, (CASE WHEN ((SubPlan 6) > 0) THEN true ELSE false END), mes.first, (CASE WHEN ((SubPlan 7) = 4) THEN true ELSE false END), (CASE WHEN ((SubPlan 8) > 0) THEN true ELSE false END), mes.last, (CASE WHEN ((SubPlan 9) = (SubPlan 10)) THEN true ELSE false END), ((SubPlan 11)), ((SubPlan 14)), ssr2.id, r.status, (concat_ws(' '::text, i.surname, i.name, i.patr_name)), mep.case_id, mesp.id, me.org_id, ((alternatives: SubPlan 15 or hashed SubPlan 16)), ((mes.org_id = 52)), ((alternatives: SubPlan 18 or hashed SubPlan 20)), 'f', ((alternatives: SubPlan 21 or hashed SubPlan 22)), ((alternatives: SubPlan 23 or hashed SubPlan 24)), ((r.status = 1)), ((SubPlan 26)), 't', (CASE mesp.status WHEN 4 THEN COALESCE((SubPlan 27), '1900-01-01'::date) WHEN 3 THEN COALESCE((SubPlan 28), '1900-01-01'::date) ELSE '1900-01-01'::date END)
  • Buffers: shared hit=11
2. 0.001 0.149 ↓ 0.0 0 1

Result (cost=23,194,465.08..23,197,939.91 rows=1 width=445) (actual time=0.149..0.149 rows=0 loops=1)

  • Output: mesp.id, mesp.event_id, mesp.indiv_id, mep.id, mnds.code, ss.id, ss.name, po.id, CASE mesp.status WHEN 4 THEN po.short_name WHEN 3 THEN (NULLIF(((SubPlan 1))::text, NULL::text))::character varying ELSE NULL::character varying END, srg.id, CASE mesp.status WHEN 4 THEN srg.name WHEN 3 THEN (NULLIF(((SubPlan 2))::text, NULL::text))::character varying ELSE NULL::character varying END, mess.id, mess.name, CASE mesp.status WHEN 4 THEN NULLIF((SubPlan 3), NULL::date) WHEN 3 THEN NULLIF((SubPlan 4), NULL::date) ELSE NULL::date END, CASE mesp.status WHEN 2 THEN NULLIF((SubPlan 5), NULL::date) ELSE NULL::date END, mespa.agree, mes.order_idx, mes.first, mes.last, CASE WHEN ((SubPlan 6) > 0) THEN true ELSE false END, mes.first, CASE WHEN ((SubPlan 7) = 4) THEN true ELSE false END, CASE WHEN ((SubPlan 8) > 0) THEN true ELSE false END, mes.last, CASE WHEN ((SubPlan 9) = (SubPlan 10)) THEN true ELSE false END, (SubPlan 11), (SubPlan 14), ssr2.id, r.status, (concat_ws(' '::text, i.surname, i.name, i.patr_name)), mep.case_id, mesp.id, me.org_id, (alternatives: SubPlan 15 or hashed SubPlan 16), ((mes.org_id = 52)), (alternatives: SubPlan 18 or hashed SubPlan 20), 'f', (alternatives: SubPlan 21 or hashed SubPlan 22), (alternatives: SubPlan 23 or hashed SubPlan 24), ((r.status = 1)), (SubPlan 26), 't', (CASE mesp.status WHEN 4 THEN COALESCE((SubPlan 27), '1900-01-01'::date) WHEN 3 THEN COALESCE((SubPlan 28), '1900-01-01'::date) ELSE '1900-01-01'::date END)
  • Buffers: shared hit=11
3. 0.038 0.148 ↓ 0.0 0 1

Sort (cost=23,194,465.08..23,194,465.09 rows=1 width=432) (actual time=0.148..0.148 rows=0 loops=1)

  • Output: mesp.id, mesp.event_id, mesp.indiv_id, mep.id, mnds.code, ss.id, ss.name, po.id, srg.id, mess.id, mess.name, mespa.agree, mes.order_idx, mes.first, mes.last, mes.first, mes.last, ssr2.id, r.status, (concat_ws(' '::text, i.surname, i.name, i.patr_name)), mep.case_id, mesp.id, me.org_id, ((mes.org_id = 52)), 'f', ((r.status = 1)), 't', (CASE mesp.status WHEN 4 THEN COALESCE((SubPlan 27), '1900-01-01'::date) WHEN 3 THEN COALESCE((SubPlan 28), '1900-01-01'::date) ELSE '1900-01-01'::date END), mesp.status, po.short_name, mes.id, srg.name, mes.service_id, mes.event_id, gs.id
  • Sort Key: (CASE mesp.status WHEN 4 THEN COALESCE((SubPlan 27), '1900-01-01'::date) WHEN 3 THEN COALESCE((SubPlan 28), '1900-01-01'::date) ELSE '1900-01-01'::date END) DESC
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=11
4. 0.002 0.110 ↓ 0.0 0 1

Nested Loop Semi Join (cost=2.25..23,194,465.07 rows=1 width=432) (actual time=0.110..0.110 rows=0 loops=1)

  • Output: mesp.id, mesp.event_id, mesp.indiv_id, mep.id, mnds.code, ss.id, ss.name, po.id, srg.id, mess.id, mess.name, mespa.agree, mes.order_idx, mes.first, mes.last, mes.first, mes.last, ssr2.id, r.status, concat_ws(' '::text, i.surname, i.name, i.patr_name), mep.case_id, mesp.id, me.org_id, (mes.org_id = 52), 'f', (r.status = 1), 't', CASE mesp.status WHEN 4 THEN COALESCE((SubPlan 27), '1900-01-01'::date) WHEN 3 THEN COALESCE((SubPlan 28), '1900-01-01'::date) ELSE '1900-01-01'::date END, mesp.status, po.short_name, mes.id, srg.name, mes.service_id, mes.event_id, gs.id
  • Join Filter: (SubPlan 29)
  • Buffers: shared hit=8
5. 0.000 0.108 ↓ 0.0 0 1

Nested Loop (cost=2.25..147,463.67 rows=1 width=376) (actual time=0.108..0.108 rows=0 loops=1)

  • Output: mep.id, mep.case_id, i.surname, i.name, i.patr_name, mesp.id, mesp.event_id, mesp.indiv_id, mesp.status, mespa.agree, mes.id, mes.service_id, mes.order_idx, mes.first, mes.last, mes.event_id, mes.org_id, me.org_id, mnds.code, ssr2.id, po.id, po.short_name, ss.id, ss.name, mess.id, mess.name, srg.id, srg.name, gs.id, r.status
  • Join Filter: (mesp.event_patient_id = r.id)
  • Buffers: shared hit=8
6. 0.000 0.108 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.25..147,452.28 rows=1 width=376) (actual time=0.108..0.108 rows=0 loops=1)

  • Output: mep.id, mep.case_id, i.surname, i.name, i.patr_name, mesp.id, mesp.event_id, mesp.indiv_id, mesp.status, mesp.event_patient_id, mespa.agree, mes.id, mes.service_id, mes.order_idx, mes.first, mes.last, mes.event_id, mes.org_id, me.org_id, mnds.code, ssr2.id, po.id, po.short_name, ss.id, ss.name, mess.id, mess.name, srg.id, srg.name, gs.id
  • Join Filter: ((gs.service_id = ssr2.id) AND (gs.event_patient_id = mep.id))
  • Buffers: shared hit=8
7. 0.000 0.108 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.25..147,434.03 rows=1 width=372) (actual time=0.108..0.108 rows=0 loops=1)

  • Output: mep.id, mep.case_id, i.surname, i.name, i.patr_name, mesp.id, mesp.event_id, mesp.indiv_id, mesp.status, mesp.event_patient_id, mespa.agree, mes.id, mes.service_id, mes.order_idx, mes.first, mes.last, mes.event_id, mes.org_id, me.org_id, mnds.code, ssr2.id, po.id, po.short_name, ss.id, ss.name, mess.id, mess.name, srg.id, srg.name
  • Buffers: shared hit=8
8. 0.000 0.108 ↓ 0.0 0 1

Nested Loop (cost=1.69..147,431.05 rows=1 width=296) (actual time=0.108..0.108 rows=0 loops=1)

  • Output: mep.id, mep.case_id, i.surname, i.name, i.patr_name, mesp.id, mesp.event_id, mesp.indiv_id, mesp.status, mesp.event_patient_id, mespa.agree, mes.id, mes.service_id, mes.order_idx, mes.first, mes.last, mes.event_id, mes.org_id, me.org_id, mnds.code, ssr2.id, ssr2.res_group_id, po.id, po.short_name, ss.id, ss.name, mess.id, mess.name
  • Join Filter: (mesp.status = mess.code)
  • Buffers: shared hit=8
9. 0.000 0.108 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.69..147,429.98 rows=1 width=275) (actual time=0.108..0.108 rows=0 loops=1)

  • Output: mep.id, mep.case_id, i.surname, i.name, i.patr_name, mesp.id, mesp.event_id, mesp.indiv_id, mesp.status, mesp.event_patient_id, mespa.agree, mes.id, mes.service_id, mes.order_idx, mes.first, mes.last, mes.event_id, mes.org_id, me.org_id, mnds.code, ssr2.id, ssr2.res_group_id, po.id, po.short_name, ss.id, ss.name
  • Join Filter: (ss.id = mes.service_id)
  • Buffers: shared hit=8
10. 0.000 0.108 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.69..111,711.93 rows=1 width=162) (actual time=0.108..0.108 rows=0 loops=1)

  • Output: mep.id, mep.case_id, i.surname, i.name, i.patr_name, mesp.id, mesp.event_id, mesp.indiv_id, mesp.status, mesp.event_patient_id, mespa.agree, mes.id, mes.service_id, mes.order_idx, mes.first, mes.last, mes.event_id, mes.org_id, me.org_id, mnds.code, ssr2.id, ssr2.res_group_id, po.id, po.short_name
  • Join Filter: (po.id = mes.org_id)
  • Buffers: shared hit=8
11. 0.001 0.108 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.40..111,703.62 rows=1 width=119) (actual time=0.108..0.108 rows=0 loops=1)

  • Output: mep.id, mep.case_id, i.surname, i.name, i.patr_name, mesp.id, mesp.event_id, mesp.indiv_id, mesp.status, mesp.event_patient_id, mespa.agree, mes.id, mes.service_id, mes.order_idx, mes.first, mes.last, mes.event_id, mes.org_id, me.org_id, mnds.code, ssr2.id, ssr2.res_group_id
  • Join Filter: (ssr2.service_id = mes.service_id)
  • Buffers: shared hit=8
12. 0.000 0.107 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.28..111,351.53 rows=1 width=111) (actual time=0.107..0.107 rows=0 loops=1)

  • Output: mep.id, mep.case_id, i.surname, i.name, i.patr_name, mesp.id, mesp.event_id, mesp.indiv_id, mesp.status, mesp.event_patient_id, mespa.agree, mes.id, mes.service_id, mes.order_idx, mes.first, mes.last, mes.event_id, mes.org_id, me.org_id, mnds.code
  • Join Filter: (mnds.id = mes.doc_service_id)
  • Buffers: shared hit=8
13. 0.000 0.107 ↓ 0.0 0 1

Nested Loop (cost=0.28..111,342.91 rows=1 width=107) (actual time=0.107..0.107 rows=0 loops=1)

  • Output: mep.id, mep.case_id, i.surname, i.name, i.patr_name, mesp.id, mesp.event_id, mesp.indiv_id, mesp.status, mesp.event_patient_id, mespa.agree, mes.id, mes.service_id, mes.order_idx, mes.first, mes.last, mes.event_id, mes.org_id, mes.doc_service_id, me.org_id
  • Join Filter: (mep.event_id = me.id)
  • Buffers: shared hit=8
14. 0.001 0.107 ↓ 0.0 0 1

Nested Loop (cost=0.28..111,341.56 rows=1 width=107) (actual time=0.107..0.107 rows=0 loops=1)

  • Output: mep.id, mep.case_id, mep.event_id, i.surname, i.name, i.patr_name, mesp.id, mesp.event_id, mesp.indiv_id, mesp.status, mesp.event_patient_id, mespa.agree, mes.id, mes.service_id, mes.order_idx, mes.first, mes.last, mes.event_id, mes.org_id, mes.doc_service_id
  • Join Filter: (mesp.service_id = mes.id)
  • Buffers: shared hit=8
15. 0.000 0.106 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.00..111,336.36 rows=1 width=85) (actual time=0.106..0.106 rows=0 loops=1)

  • Output: mep.id, mep.case_id, mep.event_id, i.surname, i.name, i.patr_name, mesp.id, mesp.event_id, mesp.indiv_id, mesp.status, mesp.event_patient_id, mesp.service_id, mespa.agree
  • Join Filter: (mespa.service_id = mesp.id)
  • Buffers: shared hit=8
16. 0.000 0.106 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.00..111,323.15 rows=1 width=84) (actual time=0.106..0.106 rows=0 loops=1)

  • Output: mep.id, mep.case_id, mep.event_id, i.surname, i.name, i.patr_name, mesp.id, mesp.event_id, mesp.indiv_id, mesp.status, mesp.event_patient_id, mesp.service_id
  • Join Filter: (i.id = mep.indiv_id)
  • Buffers: shared hit=8
17. 0.001 0.106 ↓ 0.0 0 1

Nested Loop (cost=0.00..16.39 rows=1 width=40) (actual time=0.106..0.106 rows=0 loops=1)

  • Output: mep.id, mep.case_id, mep.indiv_id, mep.event_id, mesp.id, mesp.event_id, mesp.indiv_id, mesp.status, mesp.event_patient_id, mesp.service_id
  • Join Filter: (mep.id = mesp.event_patient_id)
  • Buffers: shared hit=8
18. 0.105 0.105 ↓ 0.0 0 1

Seq Scan on disp.md_event_service_patient mesp (cost=0.00..13.00 rows=1 width=24) (actual time=0.105..0.105 rows=0 loops=1)

  • Output: mesp.id, mesp.service_id, mesp.indiv_id, mesp.event_id, mesp.aud_who, mesp.aud_when, mesp.aud_source, mesp.aud_who_create, mesp.aud_when_create, mesp.aud_source_create, mesp.event_patient_id, mesp.barcode, mesp.biomaterial_dt, mesp.specialist_snils, mesp.status, mesp.referral_id
  • Filter: (mesp.event_id = 1082)
  • Rows Removed by Filter: 400
  • Buffers: shared hit=8
19. 0.000 0.000 ↓ 0.0 0

Seq Scan on disp.md_event_patient mep (cost=0.00..2.62 rows=62 width=16) (never executed)

  • Output: mep.id, mep.case_id, mep.indiv_id, mep.event_id
20. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.pim_individual i (cost=0.00..98,254.67 rows=1,044,167 width=52) (never executed)

  • Output: i.id, i.birth_dt, i.death_dt, i.has_citizenship, i.name, i.patr_name, i.surname, i.gender_id, i.nationality_id, i.list_identity_doc, i.list_oms_doc, i.list_job_org, i.list_reg_name, i.list_snils, i.list_uid, i.aud_who, i.aud_when, i.aud_source, i.aud_who_create, i.aud_when_create, i.aud_source_create, i.birth_place, i.birth_time, i.death_time, i.list_main_contact, i.age_year, i.age_month, i.age_day
21. 0.000 0.000 ↓ 0.0 0

Seq Scan on disp.md_event_service_patient_agreement mespa (cost=0.00..8.65 rows=365 width=5) (never executed)

  • Output: mespa.id, mespa.service_id, mespa.agree, mespa.denial, mespa.agree_date, mespa.aud_who, mespa.aud_when, mespa.aud_source, mespa.aud_who_create, mespa.aud_when_create, mespa.aud_source_create
22. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_md_event_service_0 on disp.md_event_service mes (cost=0.28..5.18 rows=1 width=26) (never executed)

  • Output: mes.id, mes.event_id, mes.org_id, mes.resource_id, mes.service_id, mes.first, mes.last, mes.district_check, mes.standard_prescription_id, mes.order_idx, mes.aud_who, mes.aud_when, mes.aud_source, mes.aud_who_create, mes.aud_when_create, mes.aud_source_create, mes.ignore_service, mes.is_mobile_medical_teams, mes.required, mes.doc_service_id, mes.res_group_service_id, mes.is_2_stage, mes.is_not_assigned, mes.is_created_system, mes.room
  • Index Cond: (mes.org_id = 52)
23. 0.000 0.000 ↓ 0.0 0

Seq Scan on disp.md_event me (cost=0.00..1.34 rows=1 width=12) (never executed)

  • Output: me.id, me.org_id, me.event_type, me.name, me.standard_id, me.start_date, me.pay_type, me.end_date, me.aud_who, me.aud_when, me.aud_source, me.aud_who_create, me.aud_when_create, me.aud_source_create, me.is_mobile_medical_teams, me.count_mmt, me.is_deleted, me.pay_method, me.mes_id, me.norm_document_id, me.employee_position_id, me.care_level_id
  • Filter: (me.org_id = 52)
24. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.md_norm_document_service mnds (cost=0.00..6.61 rows=161 width=12) (never executed)

  • Output: mnds.id, mnds.document_id, mnds.code, mnds.name, mnds.srv_type_id, mnds.srv_prot_id, mnds.note, mnds.aud_who, mnds.aud_when, mnds.aud_source, mnds.aud_who_create, mnds.aud_when_create, mnds.aud_source_create, mnds.no, mnds.is_deleted, mnds.okmu_id
25. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.13..350.77 rows=106 width=16) (never executed)

  • Output: amsr2.case_id, ssr2.id, ssr2.service_id, ssr2.res_group_id
26. 0.000 0.000 ↓ 0.0 0

Index Scan using md_srv_rendered_case_fk on public.md_srv_rendered amsr2 (cost=0.56..12.42 rows=106 width=8) (never executed)

  • Output: amsr2.id, amsr2.is_urgent, amsr2.is_use_cryogenic, amsr2.is_use_endoscopic, amsr2.is_use_laser, amsr2.anesthesia_type_id, amsr2.step_id, amsr2.complication_type_id, amsr2.diagnosis_id, amsr2.case_id, amsr2.referral_id, amsr2.result_category_id, amsr2.patient_prescription_id, amsr2.health_group_id, amsr2.vmp_type_id, amsr2.vmp_method_id, amsr2.anatomic_zone_id, amsr2.aud_who, amsr2.aud_when, amsr2.aud_source, amsr2.aud_who_create, amsr2.aud_when_create, amsr2.aud_source_create, amsr2.prescription_id, amsr2.entity_sync_num, amsr2.complicated_value, amsr2.by_standard, amsr2.vmp_profile_id
  • Index Cond: (amsr2.case_id = mep.case_id)
27. 0.000 0.000 ↓ 0.0 0

Index Scan using sr_srv_rendered_pk on public.sr_srv_rendered ssr2 (cost=0.56..3.18 rows=1 width=12) (never executed)

  • Output: ssr2.id, ssr2.bdate, ssr2.comment, ssr2.cost, ssr2.duration, ssr2.edate, ssr2.is_rendered, ssr2.quantity, ssr2.total_cost, ssr2.contract_id, ssr2.customer_id, ssr2.funding_id, ssr2.res_group_id, ssr2.service_id, ssr2.duration_measure_unit_id, ssr2.begin_time, ssr2.prototype_id, ssr2.org_id, ssr2.price_list_id, ssr2.cul, ssr2.parent_id, ssr2.payment_status_id, ssr2.root_service_id, ssr2.is_wholly_rendered, ssr2.planned_date, ssr2.planned_time, ssr2.tooth_number, ssr2.is_refused, ssr2.aud_who, ssr2.aud_when, ssr2.aud_source, ssr2.aud_who_create, ssr2.aud_when_create, ssr2.aud_source_create, ssr2.is_amalgam_filling, ssr2.is_mobile_medical_teams, ssr2._responsible_id, ssr2._department_id, ssr2.entity_type, ssr2.md_is_urgent, ssr2.md_is_use_cryogenic, ssr2.md_is_use_endoscopic, ssr2.md_is_use_laser, ssr2.md_anesthesia_type_id, ssr2.md_step_id, ssr2.md_complication_type_id, ssr2.md_diagnosis_id, ssr2.md_case_id, ssr2.md_referral_id, ssr2.md_result_category_id, ssr2.md_patient_prescription_id, ssr2.md_health_group_id, ssr2.md_vmp_type_id, ssr2.md_vmp_method_id, ssr2.md_anatomic_zone_id, ssr2.md_prescription_id, ssr2.entity_sync_num, ssr2.entity_type_aware, ssr2._created_by_dep_id, ssr2.cancel_reason, ssr2.close_date, ssr2.complex_srv_id, ssr2.for_upload, ssr2.uid, ssr2.is_need_consulting
  • Index Cond: (ssr2.id = amsr2.id)
28. 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=43) (never executed)

  • Output: po.id, po.short_name
  • Index Cond: (po.id = 52)
29. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.sr_service ss (cost=0.00..26,934.13 rows=702,713 width=113) (never executed)

  • Output: ss.id, ss.code, ss.cul, ss.is_death, ss.duration, ss.is_fictitious, ss.is_independent, ss.is_multuplicity, ss.name, ss.terms, ss.org_id, ss.category_id, ss.duration_unit_id, ss.prototype_id, ss.type_id, ss.from_dt, ss.to_dt, ss.is_repeated, ss.is_inherit_protocol, ss.is_expendable_materials, ss.is_actual_cul, ss.is_paraclinical, ss.is_complex, ss.accounting_id, ss.is_autocopy_diagnoses, ss.is_stomat, ss.srg_dif_type_id, ss.srg_opr_kind_id, ss.is_need_anatomic_zone, ss.aud_who, ss.aud_when, ss.aud_source, ss.aud_who_create, ss.aud_when_create, ss.aud_source_create, ss.is_filling, ss.is_extraction, ss.short_name, ss.is_need_close_date, ss.is_vmp
30. 0.000 0.000 ↓ 0.0 0

Seq Scan on disp.md_event_service_status mess (cost=0.00..1.06 rows=1 width=25) (never executed)

  • Output: mess.id, mess.code, mess.name, mess.aud_who, mess.aud_when, mess.aud_source, mess.aud_who_create, mess.aud_when_create, mess.aud_source_create
  • Filter: ((mess.id = 1) AND (mess.name = 'Назначена'::text))
31. 0.000 0.000 ↓ 0.0 0

Index Scan using sr_res_group_pk on public.sr_res_group srg (cost=0.56..2.97 rows=1 width=80) (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
  • Index Cond: (srg.id = ssr2.res_group_id)
32. 0.000 0.000 ↓ 0.0 0

Seq Scan on gibdd.md_gibdd_service gs (cost=0.00..13.30 rows=330 width=12) (never executed)

  • Output: gs.id, gs.service_id, gs.event_patient_id
33. 0.000 0.000 ↓ 0.0 0

Seq Scan on gibdd.md_gibdd_reference r (cost=0.00..11.38 rows=1 width=8) (never executed)

  • Output: r.status, r.id
  • Filter: (r.status = 1)
34. 0.000 0.000 ↓ 0.0 0

Materialize (cost=0.00..3,194.02 rows=106,935 width=8) (never executed)

  • Output: srgs.group_id, srgs.srv_type_id
35. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.sr_res_group_service srgs (cost=0.00..2,659.35 rows=106,935 width=8) (never executed)

  • Output: srgs.group_id, srgs.srv_type_id
36.          

SubPlan (forNested Loop Semi Join)

37. 0.000 0.000 ↓ 0.0 0

Limit (cost=1.13..923.51 rows=1 width=4) (never executed)

  • Output: ssr_4.bdate
38. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.13..923.51 rows=1 width=4) (never executed)

  • Output: ssr_4.bdate
39. 0.000 0.000 ↓ 0.0 0

Index Scan using md_srv_rendered_case_fk on public.md_srv_rendered msr_1 (cost=0.56..12.44 rows=106 width=4) (never executed)

  • Output: msr_1.id, msr_1.is_urgent, msr_1.is_use_cryogenic, msr_1.is_use_endoscopic, msr_1.is_use_laser, msr_1.anesthesia_type_id, msr_1.step_id, msr_1.complication_type_id, msr_1.diagnosis_id, msr_1.case_id, msr_1.referral_id, msr_1.result_category_id, msr_1.patient_prescription_id, msr_1.health_group_id, msr_1.vmp_type_id, msr_1.vmp_method_id, msr_1.anatomic_zone_id, msr_1.aud_who, msr_1.aud_when, msr_1.aud_source, msr_1.aud_who_create, msr_1.aud_when_create, msr_1.aud_source_create, msr_1.prescription_id, msr_1.entity_sync_num, msr_1.complicated_value, msr_1.by_standard, msr_1.vmp_profile_id
  • Index Cond: (msr_1.case_id = mep.case_id)
40. 0.000 0.000 ↓ 0.0 0

Index Scan using sr_srv_rendered_pk on public.sr_srv_rendered ssr_4 (cost=0.56..8.58 rows=1 width=8) (never executed)

  • Output: ssr_4.id, ssr_4.bdate, ssr_4.comment, ssr_4.cost, ssr_4.duration, ssr_4.edate, ssr_4.is_rendered, ssr_4.quantity, ssr_4.total_cost, ssr_4.contract_id, ssr_4.customer_id, ssr_4.funding_id, ssr_4.res_group_id, ssr_4.service_id, ssr_4.duration_measure_unit_id, ssr_4.begin_time, ssr_4.prototype_id, ssr_4.org_id, ssr_4.price_list_id, ssr_4.cul, ssr_4.parent_id, ssr_4.payment_status_id, ssr_4.root_service_id, ssr_4.is_wholly_rendered, ssr_4.planned_date, ssr_4.planned_time, ssr_4.tooth_number, ssr_4.is_refused, ssr_4.aud_who, ssr_4.aud_when, ssr_4.aud_source, ssr_4.aud_who_create, ssr_4.aud_when_create, ssr_4.aud_source_create, ssr_4.is_amalgam_filling, ssr_4.is_mobile_medical_teams, ssr_4._responsible_id, ssr_4._department_id, ssr_4.entity_type, ssr_4.md_is_urgent, ssr_4.md_is_use_cryogenic, ssr_4.md_is_use_endoscopic, ssr_4.md_is_use_laser, ssr_4.md_anesthesia_type_id, ssr_4.md_step_id, ssr_4.md_complication_type_id, ssr_4.md_diagnosis_id, ssr_4.md_case_id, ssr_4.md_referral_id, ssr_4.md_result_category_id, ssr_4.md_patient_prescription_id, ssr_4.md_health_group_id, ssr_4.md_vmp_type_id, ssr_4.md_vmp_method_id, ssr_4.md_anatomic_zone_id, ssr_4.md_prescription_id, ssr_4.entity_sync_num, ssr_4.entity_type_aware, ssr_4._created_by_dep_id, ssr_4.cancel_reason, ssr_4.close_date, ssr_4.complex_srv_id, ssr_4.for_upload, ssr_4.uid, ssr_4.is_need_consulting
  • Index Cond: (ssr_4.id = msr_1.id)
  • Filter: (ssr_4.service_id = mes.service_id)
41. 0.000 0.000 ↓ 0.0 0

Limit (cost=0.56..10.01 rows=1 width=4) (never executed)

  • Output: ssr_5.bdate
42. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.56..10.01 rows=1 width=4) (never executed)

  • Output: ssr_5.bdate
43. 0.000 0.000 ↓ 0.0 0

Seq Scan on disp.md_event_service_link mesl_3 (cost=0.00..1.42 rows=1 width=4) (never executed)

  • Output: mesl_3.id, mesl_3.case_id, mesl_3.service_id, mesl_3.event_service_id, mesl_3.aud_who, mesl_3.aud_when, mesl_3.aud_source, mesl_3.aud_who_create, mesl_3.aud_when_create, mesl_3.aud_source_create, mesl_3.is_created
  • Filter: ((mesl_3.case_id = mep.case_id) AND (mesl_3.event_service_id = mes.id))
44. 0.000 0.000 ↓ 0.0 0

Index Scan using sr_srv_rendered_pk on public.sr_srv_rendered ssr_5 (cost=0.56..8.58 rows=1 width=8) (never executed)

  • Output: ssr_5.id, ssr_5.bdate, ssr_5.comment, ssr_5.cost, ssr_5.duration, ssr_5.edate, ssr_5.is_rendered, ssr_5.quantity, ssr_5.total_cost, ssr_5.contract_id, ssr_5.customer_id, ssr_5.funding_id, ssr_5.res_group_id, ssr_5.service_id, ssr_5.duration_measure_unit_id, ssr_5.begin_time, ssr_5.prototype_id, ssr_5.org_id, ssr_5.price_list_id, ssr_5.cul, ssr_5.parent_id, ssr_5.payment_status_id, ssr_5.root_service_id, ssr_5.is_wholly_rendered, ssr_5.planned_date, ssr_5.planned_time, ssr_5.tooth_number, ssr_5.is_refused, ssr_5.aud_who, ssr_5.aud_when, ssr_5.aud_source, ssr_5.aud_who_create, ssr_5.aud_when_create, ssr_5.aud_source_create, ssr_5.is_amalgam_filling, ssr_5.is_mobile_medical_teams, ssr_5._responsible_id, ssr_5._department_id, ssr_5.entity_type, ssr_5.md_is_urgent, ssr_5.md_is_use_cryogenic, ssr_5.md_is_use_endoscopic, ssr_5.md_is_use_laser, ssr_5.md_anesthesia_type_id, ssr_5.md_step_id, ssr_5.md_complication_type_id, ssr_5.md_diagnosis_id, ssr_5.md_case_id, ssr_5.md_referral_id, ssr_5.md_result_category_id, ssr_5.md_patient_prescription_id, ssr_5.md_health_group_id, ssr_5.md_vmp_type_id, ssr_5.md_vmp_method_id, ssr_5.md_anatomic_zone_id, ssr_5.md_prescription_id, ssr_5.entity_sync_num, ssr_5.entity_type_aware, ssr_5._created_by_dep_id, ssr_5.cancel_reason, ssr_5.close_date, ssr_5.complex_srv_id, ssr_5.for_upload, ssr_5.uid, ssr_5.is_need_consulting
  • Index Cond: (ssr_5.id = mesl_3.service_id)
45. 0.000 0.000 ↓ 0.0 0

Result (cost=0.56..407.94 rows=8,974 width=4) (never executed)

  • Output: srgx.id
  • One-Time Filter: (ss.id = srgs.srv_type_id)
46. 0.000 0.000 ↓ 0.0 0

Index Only Scan using sr_res_group_responsible_id_id_ix on public.sr_res_group srgx (cost=0.56..407.94 rows=8,974 width=4) (never executed)

  • Output: srgx.responsible_id, srgx.id
  • Index Cond: (srgx.responsible_id = 16509)
  • Heap Fetches: 0
47.          

SubPlan (forResult)

48. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=0.85..10.33 rows=1 width=39) (never executed)

  • Output: po2.short_name
49. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.56..10.01 rows=1 width=4) (never executed)

  • Output: ssr.org_id
50. 0.000 0.000 ↓ 0.0 0

Seq Scan on disp.md_event_service_link mesl (cost=0.00..1.42 rows=1 width=4) (never executed)

  • Output: mesl.id, mesl.case_id, mesl.service_id, mesl.event_service_id, mesl.aud_who, mesl.aud_when, mesl.aud_source, mesl.aud_who_create, mesl.aud_when_create, mesl.aud_source_create, mesl.is_created
  • Filter: ((mesl.case_id = mep.case_id) AND (mesl.event_service_id = mes.id))
51. 0.000 0.000 ↓ 0.0 0

Index Scan using sr_srv_rendered_pk on public.sr_srv_rendered ssr (cost=0.56..8.58 rows=1 width=8) (never executed)

  • 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._responsible_id, ssr._department_id, ssr.entity_type, ssr.md_is_urgent, ssr.md_is_use_cryogenic, ssr.md_is_use_endoscopic, ssr.md_is_use_laser, ssr.md_anesthesia_type_id, ssr.md_step_id, ssr.md_complication_type_id, ssr.md_diagnosis_id, ssr.md_case_id, ssr.md_referral_id, ssr.md_result_category_id, ssr.md_patient_prescription_id, ssr.md_health_group_id, ssr.md_vmp_type_id, ssr.md_vmp_method_id, ssr.md_anatomic_zone_id, ssr.md_prescription_id, ssr.entity_sync_num, ssr.entity_type_aware, ssr._created_by_dep_id, ssr.cancel_reason, ssr.close_date, ssr.complex_srv_id, ssr.for_upload, ssr.uid, ssr.is_need_consulting
  • Index Cond: (ssr.id = mesl.service_id)
52. 0.000 0.000 ↓ 0.0 0

Index Scan using pim_organization_pk on public.pim_organization po2 (cost=0.29..0.30 rows=1 width=43) (never executed)

  • Output: po2.short_name, po2.id
  • Index Cond: (po2.id = ssr.org_id)
53. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=1.13..11.71 rows=1 width=76) (never executed)

  • Output: srg2.name
54. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.56..10.01 rows=1 width=4) (never executed)

  • Output: ssr_1.res_group_id
55. 0.000 0.000 ↓ 0.0 0

Seq Scan on disp.md_event_service_link mesl_1 (cost=0.00..1.42 rows=1 width=4) (never executed)

  • Output: mesl_1.id, mesl_1.case_id, mesl_1.service_id, mesl_1.event_service_id, mesl_1.aud_who, mesl_1.aud_when, mesl_1.aud_source, mesl_1.aud_who_create, mesl_1.aud_when_create, mesl_1.aud_source_create, mesl_1.is_created
  • Filter: ((mesl_1.case_id = mep.case_id) AND (mesl_1.event_service_id = mes.id))
56. 0.000 0.000 ↓ 0.0 0

Index Scan using sr_srv_rendered_pk on public.sr_srv_rendered ssr_1 (cost=0.56..8.58 rows=1 width=8) (never executed)

  • Output: ssr_1.id, ssr_1.bdate, ssr_1.comment, ssr_1.cost, ssr_1.duration, ssr_1.edate, ssr_1.is_rendered, ssr_1.quantity, ssr_1.total_cost, ssr_1.contract_id, ssr_1.customer_id, ssr_1.funding_id, ssr_1.res_group_id, ssr_1.service_id, ssr_1.duration_measure_unit_id, ssr_1.begin_time, ssr_1.prototype_id, ssr_1.org_id, ssr_1.price_list_id, ssr_1.cul, ssr_1.parent_id, ssr_1.payment_status_id, ssr_1.root_service_id, ssr_1.is_wholly_rendered, ssr_1.planned_date, ssr_1.planned_time, ssr_1.tooth_number, ssr_1.is_refused, ssr_1.aud_who, ssr_1.aud_when, ssr_1.aud_source, ssr_1.aud_who_create, ssr_1.aud_when_create, ssr_1.aud_source_create, ssr_1.is_amalgam_filling, ssr_1.is_mobile_medical_teams, ssr_1._responsible_id, ssr_1._department_id, ssr_1.entity_type, ssr_1.md_is_urgent, ssr_1.md_is_use_cryogenic, ssr_1.md_is_use_endoscopic, ssr_1.md_is_use_laser, ssr_1.md_anesthesia_type_id, ssr_1.md_step_id, ssr_1.md_complication_type_id, ssr_1.md_diagnosis_id, ssr_1.md_case_id, ssr_1.md_referral_id, ssr_1.md_result_category_id, ssr_1.md_patient_prescription_id, ssr_1.md_health_group_id, ssr_1.md_vmp_type_id, ssr_1.md_vmp_method_id, ssr_1.md_anatomic_zone_id, ssr_1.md_prescription_id, ssr_1.entity_sync_num, ssr_1.entity_type_aware, ssr_1._created_by_dep_id, ssr_1.cancel_reason, ssr_1.close_date, ssr_1.complex_srv_id, ssr_1.for_upload, ssr_1.uid, ssr_1.is_need_consulting
  • Index Cond: (ssr_1.id = mesl_1.service_id)
57. 0.000 0.000 ↓ 0.0 0

Index Scan using sr_res_group_pk on public.sr_res_group srg2 (cost=0.56..1.69 rows=1 width=80) (never executed)

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

Limit (cost=1.13..923.51 rows=1 width=4) (never executed)

  • Output: ssr_2.bdate
59. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.13..923.51 rows=1 width=4) (never executed)

  • Output: ssr_2.bdate
60. 0.000 0.000 ↓ 0.0 0

Index Scan using md_srv_rendered_case_fk on public.md_srv_rendered msr (cost=0.56..12.44 rows=106 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 = mep.case_id)
61. 0.000 0.000 ↓ 0.0 0

Index Scan using sr_srv_rendered_pk on public.sr_srv_rendered ssr_2 (cost=0.56..8.58 rows=1 width=8) (never executed)

  • Output: ssr_2.id, ssr_2.bdate, ssr_2.comment, ssr_2.cost, ssr_2.duration, ssr_2.edate, ssr_2.is_rendered, ssr_2.quantity, ssr_2.total_cost, ssr_2.contract_id, ssr_2.customer_id, ssr_2.funding_id, ssr_2.res_group_id, ssr_2.service_id, ssr_2.duration_measure_unit_id, ssr_2.begin_time, ssr_2.prototype_id, ssr_2.org_id, ssr_2.price_list_id, ssr_2.cul, ssr_2.parent_id, ssr_2.payment_status_id, ssr_2.root_service_id, ssr_2.is_wholly_rendered, ssr_2.planned_date, ssr_2.planned_time, ssr_2.tooth_number, ssr_2.is_refused, ssr_2.aud_who, ssr_2.aud_when, ssr_2.aud_source, ssr_2.aud_who_create, ssr_2.aud_when_create, ssr_2.aud_source_create, ssr_2.is_amalgam_filling, ssr_2.is_mobile_medical_teams, ssr_2._responsible_id, ssr_2._department_id, ssr_2.entity_type, ssr_2.md_is_urgent, ssr_2.md_is_use_cryogenic, ssr_2.md_is_use_endoscopic, ssr_2.md_is_use_laser, ssr_2.md_anesthesia_type_id, ssr_2.md_step_id, ssr_2.md_complication_type_id, ssr_2.md_diagnosis_id, ssr_2.md_case_id, ssr_2.md_referral_id, ssr_2.md_result_category_id, ssr_2.md_patient_prescription_id, ssr_2.md_health_group_id, ssr_2.md_vmp_type_id, ssr_2.md_vmp_method_id, ssr_2.md_anatomic_zone_id, ssr_2.md_prescription_id, ssr_2.entity_sync_num, ssr_2.entity_type_aware, ssr_2._created_by_dep_id, ssr_2.cancel_reason, ssr_2.close_date, ssr_2.complex_srv_id, ssr_2.for_upload, ssr_2.uid, ssr_2.is_need_consulting
  • Index Cond: (ssr_2.id = msr.id)
  • Filter: (ssr_2.service_id = mes.service_id)
62. 0.000 0.000 ↓ 0.0 0

Limit (cost=0.56..10.01 rows=1 width=4) (never executed)

  • Output: ssr_3.bdate
63. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.56..10.01 rows=1 width=4) (never executed)

  • Output: ssr_3.bdate
64. 0.000 0.000 ↓ 0.0 0

Seq Scan on disp.md_event_service_link mesl_2 (cost=0.00..1.42 rows=1 width=4) (never executed)

  • Output: mesl_2.id, mesl_2.case_id, mesl_2.service_id, mesl_2.event_service_id, mesl_2.aud_who, mesl_2.aud_when, mesl_2.aud_source, mesl_2.aud_who_create, mesl_2.aud_when_create, mesl_2.aud_source_create, mesl_2.is_created
  • Filter: ((mesl_2.case_id = mep.case_id) AND (mesl_2.event_service_id = mes.id))
65. 0.000 0.000 ↓ 0.0 0

Index Scan using sr_srv_rendered_pk on public.sr_srv_rendered ssr_3 (cost=0.56..8.58 rows=1 width=8) (never executed)

  • Output: ssr_3.id, ssr_3.bdate, ssr_3.comment, ssr_3.cost, ssr_3.duration, ssr_3.edate, ssr_3.is_rendered, ssr_3.quantity, ssr_3.total_cost, ssr_3.contract_id, ssr_3.customer_id, ssr_3.funding_id, ssr_3.res_group_id, ssr_3.service_id, ssr_3.duration_measure_unit_id, ssr_3.begin_time, ssr_3.prototype_id, ssr_3.org_id, ssr_3.price_list_id, ssr_3.cul, ssr_3.parent_id, ssr_3.payment_status_id, ssr_3.root_service_id, ssr_3.is_wholly_rendered, ssr_3.planned_date, ssr_3.planned_time, ssr_3.tooth_number, ssr_3.is_refused, ssr_3.aud_who, ssr_3.aud_when, ssr_3.aud_source, ssr_3.aud_who_create, ssr_3.aud_when_create, ssr_3.aud_source_create, ssr_3.is_amalgam_filling, ssr_3.is_mobile_medical_teams, ssr_3._responsible_id, ssr_3._department_id, ssr_3.entity_type, ssr_3.md_is_urgent, ssr_3.md_is_use_cryogenic, ssr_3.md_is_use_endoscopic, ssr_3.md_is_use_laser, ssr_3.md_anesthesia_type_id, ssr_3.md_step_id, ssr_3.md_complication_type_id, ssr_3.md_diagnosis_id, ssr_3.md_case_id, ssr_3.md_referral_id, ssr_3.md_result_category_id, ssr_3.md_patient_prescription_id, ssr_3.md_health_group_id, ssr_3.md_vmp_type_id, ssr_3.md_vmp_method_id, ssr_3.md_anatomic_zone_id, ssr_3.md_prescription_id, ssr_3.entity_sync_num, ssr_3.entity_type_aware, ssr_3._created_by_dep_id, ssr_3.cancel_reason, ssr_3.close_date, ssr_3.complex_srv_id, ssr_3.for_upload, ssr_3.uid, ssr_3.is_need_consulting
  • Index Cond: (ssr_3.id = mesl_2.service_id)
66. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_md_event_service_patient_agreement on disp.md_event_service_patient_agreement (cost=0.27..8.29 rows=1 width=4) (never executed)

  • Output: md_event_service_patient_agreement.agree_date
  • Index Cond: (md_event_service_patient_agreement.service_id = mesp.id)
  • Filter: md_event_service_patient_agreement.denial
67. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=13.72..13.73 rows=1 width=8) (never executed)

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

Bitmap Heap Scan on disp.md_event_service (cost=4.44..13.72 rows=1 width=0) (never executed)

  • Output: md_event_service.id, md_event_service.event_id, md_event_service.org_id, md_event_service.resource_id, md_event_service.service_id, md_event_service.first, md_event_service.last, md_event_service.district_check, md_event_service.standard_prescription_id, md_event_service.order_idx, md_event_service.aud_who, md_event_service.aud_when, md_event_service.aud_source, md_event_service.aud_who_create, md_event_service.aud_when_create, md_event_service.aud_source_create, md_event_service.ignore_service, md_event_service.is_mobile_medical_teams, md_event_service.required, md_event_service.doc_service_id, md_event_service.res_group_service_id, md_event_service.is_2_stage, md_event_service.is_not_assigned, md_event_service.is_created_system, md_event_service.room
  • Recheck Cond: (md_event_service.event_id = mes.event_id)
  • Filter: md_event_service.first
69. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on idx_md_event_service (cost=0.00..4.44 rows=22 width=0) (never executed)

  • Index Cond: (md_event_service.event_id = mes.event_id)
70. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=0.55..13.03 rows=1 width=4) (never executed)

  • Output: mess1.code
  • Join Filter: (mess1.code = mesp1.status)
71. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.55..11.94 rows=1 width=4) (never executed)

  • Output: mesp1.status
72. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.27..11.08 rows=2 width=8) (never executed)

  • Output: mesp1.service_id, mesp1.status
73. 0.000 0.000 ↓ 0.0 0

Seq Scan on disp.md_event_patient mep1 (cost=0.00..2.77 rows=1 width=8) (never executed)

  • Output: mep1.indiv_id, mep1.event_id
  • Filter: (mep1.id = mep.id)
74. 0.000 0.000 ↓ 0.0 0

Index Scan using md_event_service_patient_indiv_id_event_id_idx on disp.md_event_service_patient mesp1 (cost=0.27..8.29 rows=1 width=16) (never executed)

  • Output: mesp1.id, mesp1.service_id, mesp1.indiv_id, mesp1.event_id, mesp1.aud_who, mesp1.aud_when, mesp1.aud_source, mesp1.aud_who_create, mesp1.aud_when_create, mesp1.aud_source_create, mesp1.event_patient_id, mesp1.barcode, mesp1.biomaterial_dt, mesp1.specialist_snils, mesp1.status, mesp1.referral_id
  • Index Cond: ((mesp1.indiv_id = mep1.indiv_id) AND (mesp1.event_id = mep1.event_id))
75. 0.000 0.000 ↓ 0.0 0

Index Scan using md_event_service_pkey on disp.md_event_service mes1 (cost=0.28..0.42 rows=1 width=4) (never executed)

  • Output: mes1.id, mes1.event_id, mes1.org_id, mes1.resource_id, mes1.service_id, mes1.first, mes1.last, mes1.district_check, mes1.standard_prescription_id, mes1.order_idx, mes1.aud_who, mes1.aud_when, mes1.aud_source, mes1.aud_who_create, mes1.aud_when_create, mes1.aud_source_create, mes1.ignore_service, mes1.is_mobile_medical_teams, mes1.required, mes1.doc_service_id, mes1.res_group_service_id, mes1.is_2_stage, mes1.is_not_assigned, mes1.is_created_system, mes1.room
  • Index Cond: (mes1.id = mesp1.service_id)
  • Filter: mes1.first
76. 0.000 0.000 ↓ 0.0 0

Seq Scan on disp.md_event_service_status mess1 (cost=0.00..1.04 rows=4 width=4) (never executed)

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

Aggregate (cost=13.72..13.73 rows=1 width=8) (never executed)

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

Bitmap Heap Scan on disp.md_event_service md_event_service_1 (cost=4.44..13.72 rows=1 width=0) (never executed)

  • Output: md_event_service_1.id, md_event_service_1.event_id, md_event_service_1.org_id, md_event_service_1.resource_id, md_event_service_1.service_id, md_event_service_1.first, md_event_service_1.last, md_event_service_1.district_check, md_event_service_1.standard_prescription_id, md_event_service_1.order_idx, md_event_service_1.aud_who, md_event_service_1.aud_when, md_event_service_1.aud_source, md_event_service_1.aud_who_create, md_event_service_1.aud_when_create, md_event_service_1.aud_source_create, md_event_service_1.ignore_service, md_event_service_1.is_mobile_medical_teams, md_event_service_1.required, md_event_service_1.doc_service_id, md_event_service_1.res_group_service_id, md_event_service_1.is_2_stage, md_event_service_1.is_not_assigned, md_event_service_1.is_created_system, md_event_service_1.room
  • Recheck Cond: (md_event_service_1.event_id = mes.event_id)
  • Filter: md_event_service_1.last
79. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on idx_md_event_service (cost=0.00..4.44 rows=22 width=0) (never executed)

  • Index Cond: (md_event_service_1.event_id = mes.event_id)
80. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=12.80..12.81 rows=1 width=8) (never executed)

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

Nested Loop (cost=0.55..12.80 rows=1 width=0) (never executed)

82. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=0.55..11.74 rows=1 width=4) (never executed)

  • Output: mesp1_1.status
  • Filter: ((mes1_1.last IS NULL) OR (NOT mes1_1.last))
83. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.27..11.08 rows=1 width=8) (never executed)

  • Output: mesp1_1.service_id, mesp1_1.status
84. 0.000 0.000 ↓ 0.0 0

Seq Scan on disp.md_event_patient mep1_1 (cost=0.00..2.77 rows=1 width=8) (never executed)

  • Output: mep1_1.indiv_id, mep1_1.event_id
  • Filter: (mep1_1.id = mep.id)
85. 0.000 0.000 ↓ 0.0 0

Index Scan using md_event_service_patient_indiv_id_event_id_idx on disp.md_event_service_patient mesp1_1 (cost=0.27..8.29 rows=1 width=16) (never executed)

  • Output: mesp1_1.id, mesp1_1.service_id, mesp1_1.indiv_id, mesp1_1.event_id, mesp1_1.aud_who, mesp1_1.aud_when, mesp1_1.aud_source, mesp1_1.aud_who_create, mesp1_1.aud_when_create, mesp1_1.aud_source_create, mesp1_1.event_patient_id, mesp1_1.barcode, mesp1_1.biomaterial_dt, mesp1_1.specialist_snils, mesp1_1.status, mesp1_1.referral_id
  • Index Cond: ((mesp1_1.indiv_id = mep1_1.indiv_id) AND (mesp1_1.event_id = mep1_1.event_id))
  • Filter: (mesp1_1.status = 4)
86. 0.000 0.000 ↓ 0.0 0

Index Scan using md_event_service_pkey on disp.md_event_service mes1_1 (cost=0.28..0.65 rows=1 width=5) (never executed)

  • Output: mes1_1.id, mes1_1.event_id, mes1_1.org_id, mes1_1.resource_id, mes1_1.service_id, mes1_1.first, mes1_1.last, mes1_1.district_check, mes1_1.standard_prescription_id, mes1_1.order_idx, mes1_1.aud_who, mes1_1.aud_when, mes1_1.aud_source, mes1_1.aud_who_create, mes1_1.aud_when_create, mes1_1.aud_source_create, mes1_1.ignore_service, mes1_1.is_mobile_medical_teams, mes1_1.required, mes1_1.doc_service_id, mes1_1.res_group_service_id, mes1_1.is_2_stage, mes1_1.is_not_assigned, mes1_1.is_created_system, mes1_1.room
  • Index Cond: (mes1_1.id = mesp1_1.service_id)
87. 0.000 0.000 ↓ 0.0 0

Seq Scan on disp.md_event_service_status mess1_1 (cost=0.00..1.05 rows=1 width=4) (never executed)

  • Output: mess1_1.id, mess1_1.code, mess1_1.name, mess1_1.aud_who, mess1_1.aud_when, mess1_1.aud_source, mess1_1.aud_who_create, mess1_1.aud_when_create, mess1_1.aud_source_create
  • Filter: (mess1_1.code = 4)
88. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=12.39..12.40 rows=1 width=8) (never executed)

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

Nested Loop (cost=0.69..12.39 rows=2 width=0) (never executed)

90. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.55..11.94 rows=2 width=4) (never executed)

  • Output: mes1_2.doc_service_id
91. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.27..11.08 rows=2 width=4) (never executed)

  • Output: mesp1_2.service_id
92. 0.000 0.000 ↓ 0.0 0

Seq Scan on disp.md_event_patient mep1_2 (cost=0.00..2.77 rows=1 width=8) (never executed)

  • Output: mep1_2.indiv_id, mep1_2.event_id
  • Filter: (mep1_2.id = mep.id)
93. 0.000 0.000 ↓ 0.0 0

Index Scan using md_event_service_patient_indiv_id_event_id_idx on disp.md_event_service_patient mesp1_2 (cost=0.27..8.29 rows=1 width=12) (never executed)

  • Output: mesp1_2.id, mesp1_2.service_id, mesp1_2.indiv_id, mesp1_2.event_id, mesp1_2.aud_who, mesp1_2.aud_when, mesp1_2.aud_source, mesp1_2.aud_who_create, mesp1_2.aud_when_create, mesp1_2.aud_source_create, mesp1_2.event_patient_id, mesp1_2.barcode, mesp1_2.biomaterial_dt, mesp1_2.specialist_snils, mesp1_2.status, mesp1_2.referral_id
  • Index Cond: ((mesp1_2.indiv_id = mep1_2.indiv_id) AND (mesp1_2.event_id = mep1_2.event_id))
94. 0.000 0.000 ↓ 0.0 0

Index Scan using md_event_service_pkey on disp.md_event_service mes1_2 (cost=0.28..0.42 rows=1 width=8) (never executed)

  • Output: mes1_2.id, mes1_2.event_id, mes1_2.org_id, mes1_2.resource_id, mes1_2.service_id, mes1_2.first, mes1_2.last, mes1_2.district_check, mes1_2.standard_prescription_id, mes1_2.order_idx, mes1_2.aud_who, mes1_2.aud_when, mes1_2.aud_source, mes1_2.aud_who_create, mes1_2.aud_when_create, mes1_2.aud_source_create, mes1_2.ignore_service, mes1_2.is_mobile_medical_teams, mes1_2.required, mes1_2.doc_service_id, mes1_2.res_group_service_id, mes1_2.is_2_stage, mes1_2.is_not_assigned, mes1_2.is_created_system, mes1_2.room
  • Index Cond: (mes1_2.id = mesp1_2.service_id)
95. 0.000 0.000 ↓ 0.0 0

Index Scan using md_norm_document_service_pk on public.md_norm_document_service mnds1 (cost=0.14..0.21 rows=1 width=4) (never executed)

  • Output: mnds1.id, mnds1.document_id, mnds1.code, mnds1.name, mnds1.srv_type_id, mnds1.srv_prot_id, mnds1.note, mnds1.aud_who, mnds1.aud_when, mnds1.aud_source, mnds1.aud_who_create, mnds1.aud_when_create, mnds1.aud_source_create, mnds1.no, mnds1.is_deleted, mnds1.okmu_id
  • Index Cond: (mnds1.id = mes1_2.doc_service_id)
  • Filter: ((mnds1.code)::text <> 'Д1.18'::text)
96. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=17.02..17.03 rows=1 width=32) (never executed)

  • Output: string_agg((substr((gc.name)::text, 11) || CASE gsc.is_valid WHEN CASE_TEST_EXPR THEN ' - Годен'::text ELSE ' - Не годен'::text END), ', '::text)
97. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=1.36..17.00 rows=2 width=22) (never executed)

  • Output: gc.name, gsc.is_valid
  • Hash Cond: (gsc.category_id = gc.id)
98. 0.000 0.000 ↓ 0.0 0

Seq Scan on gibdd.md_gibdd_service_category gsc (cost=0.00..15.62 rows=2 width=5) (never executed)

  • Output: gsc.gibdd_service_id, gsc.category_id, gsc.is_valid, gsc.aud_who, gsc.aud_when, gsc.aud_source, gsc.aud_who_create, gsc.aud_when_create, gsc.aud_source_create
  • Filter: (gsc.gibdd_service_id = gs.id)
99. 0.000 0.000 ↓ 0.0 0

Hash (cost=1.16..1.16 rows=16 width=25) (never executed)

  • Output: gc.name, gc.id
100. 0.000 0.000 ↓ 0.0 0

Seq Scan on gibdd.md_gibdd_category gc (cost=0.00..1.16 rows=16 width=25) (never executed)

  • Output: gc.name, gc.id
101. 0.000 0.000 ↓ 0.0 0

Result (cost=23.44..23.45 rows=1 width=4) (never executed)

  • Output: CASE WHEN (NOT $32) THEN 1 ELSE CASE WHEN $33 THEN 2 ELSE 3 END END
102.          

Initplan (forResult)

103. 0.000 0.000 ↓ 0.0 0

Seq Scan on gibdd.md_gibdd_service_category mgsc (cost=0.00..15.62 rows=2 width=0) (never executed)

  • Filter: (mgsc.gibdd_service_id = gs.id)
104. 0.000 0.000 ↓ 0.0 0

Seq Scan on gibdd.md_gibdd_service_category mgsc_1 (cost=0.00..15.62 rows=1 width=0) (never executed)

  • Filter: ((NOT mgsc_1.is_valid) AND (mgsc_1.gibdd_service_id = gs.id))
105. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=6.63..722.95 rows=1 width=0) (never executed)

  • Join Filter: (rgs.group_id = rg.id)
106. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=6.06..722.34 rows=1 width=8) (never executed)

  • Output: rgs.group_id, rgr.group_id
107. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.57..16.62 rows=1 width=8) (never executed)

  • Output: r_1.id, epr.id
108. 0.000 0.000 ↓ 0.0 0

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

  • Output: epr.id, epr.employee_position_id, epr.aud_who, epr.aud_when, epr.aud_source, epr.aud_who_create, epr.aud_when_create, epr.aud_source_create
  • Index Cond: (epr.employee_position_id = 16509)
109. 0.000 0.000 ↓ 0.0 0

Index Only Scan using sr_resource_pk on public.sr_resource r_1 (cost=0.29..8.30 rows=1 width=4) (never executed)

  • Output: r_1.id
  • Index Cond: (r_1.id = epr.id)
  • Heap Fetches: 0
110. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=5.49..704.91 rows=82 width=12) (never executed)

  • Output: rgs.group_id, rgr.group_id, rgr.resource_id
111. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on public.sr_res_group_service rgs (cost=4.93..272.12 rows=82 width=4) (never executed)

  • Output: rgs.id, rgs.bdatetime, rgs.edatetime, rgs.power, rgs.group_id, rgs.srv_type_id, rgs.moderation_required, rgs.patient_multiple_appointment_per_day, rgs.referral_required, rgs.default_service, rgs.aud_who, rgs.aud_when, rgs.aud_source, rgs.aud_who_create, rgs.aud_when_create, rgs.aud_source_create
  • Recheck Cond: (rgs.srv_type_id = ss.id)
112. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on fk_sr_res_group_srv_to_srv (cost=0.00..4.91 rows=82 width=0) (never executed)

  • Index Cond: (rgs.srv_type_id = ss.id)
113. 0.000 0.000 ↓ 0.0 0

Index Only Scan using sr_res_group_relationship_resource_id_group_id_ix on public.sr_res_group_relationship rgr (cost=0.56..5.27 rows=1 width=8) (never executed)

  • Output: rgr.resource_id, rgr.group_id
  • Index Cond: ((rgr.resource_id = r_1.id) AND (rgr.group_id = rgs.group_id))
  • Heap Fetches: 0
114. 0.000 0.000 ↓ 0.0 0

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

  • Output: rg.id
  • Index Cond: (rg.id = rgr.group_id)
  • Heap Fetches: 0
115. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=2.12..3,076.68 rows=14 width=4) (never executed)

  • Output: rgs_1.srv_type_id
  • Join Filter: (rgs_1.group_id = rg_1.id)
116. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.55..2,969.89 rows=177 width=12) (never executed)

  • Output: rgs_1.srv_type_id, rgs_1.group_id, rgr_1.group_id
117. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.14..503.14 rows=4,932 width=4) (never executed)

  • Output: rgr_1.group_id
118. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.57..16.62 rows=1 width=8) (never executed)

  • Output: r_2.id, epr_1.id
119. 0.000 0.000 ↓ 0.0 0

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

  • Output: epr_1.id, epr_1.employee_position_id, epr_1.aud_who, epr_1.aud_when, epr_1.aud_source, epr_1.aud_who_create, epr_1.aud_when_create, epr_1.aud_source_create
  • Index Cond: (epr_1.employee_position_id = 16509)
120. 0.000 0.000 ↓ 0.0 0

Index Only Scan using sr_resource_pk on public.sr_resource r_2 (cost=0.29..8.30 rows=1 width=4) (never executed)

  • Output: r_2.id
  • Index Cond: (r_2.id = epr_1.id)
  • Heap Fetches: 0
121. 0.000 0.000 ↓ 0.0 0

Index Only Scan using sr_res_group_relationship_resource_id_group_id_ix on public.sr_res_group_relationship rgr_1 (cost=0.56..352.64 rows=13,388 width=8) (never executed)

  • Output: rgr_1.resource_id, rgr_1.group_id
  • Index Cond: (rgr_1.resource_id = r_2.id)
  • Heap Fetches: 0
122. 0.000 0.000 ↓ 0.0 0

Index Scan using fk_sr_res_gr_srv_to_res_gr on public.sr_res_group_service rgs_1 (cost=0.42..0.47 rows=3 width=8) (never executed)

  • Output: rgs_1.id, rgs_1.bdatetime, rgs_1.edatetime, rgs_1.power, rgs_1.group_id, rgs_1.srv_type_id, rgs_1.moderation_required, rgs_1.patient_multiple_appointment_per_day, rgs_1.referral_required, rgs_1.default_service, rgs_1.aud_who, rgs_1.aud_when, rgs_1.aud_source, rgs_1.aud_who_create, rgs_1.aud_when_create, rgs_1.aud_source_create
  • Index Cond: (rgs_1.group_id = rgr_1.group_id)
123. 0.000 0.000 ↓ 0.0 0

Index Only Scan using sr_res_group_pk on public.sr_res_group rg_1 (cost=0.56..0.59 rows=1 width=4) (never executed)

  • Output: rg_1.id
  • Index Cond: (rg_1.id = rgr_1.group_id)
  • Heap Fetches: 0
124. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=6.92..723.26 rows=1 width=0) (never executed)

125.          

Initplan (forNested Loop)

126. 0.000 0.000 ↓ 0.0 0

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

  • Output: employee_id
  • One-Time Filter: false
127. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=6.63..722.95 rows=1 width=8) (never executed)

  • Output: rgr_2.resource_id, epr_2.id
  • Join Filter: (rgs_2.group_id = rg_2.id)
128. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=6.07..722.35 rows=1 width=16) (never executed)

  • Output: rgs_2.group_id, rgr_2.group_id, rgr_2.resource_id, epr_2.id
129. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.57..16.62 rows=1 width=4) (never executed)

  • Output: epr_2.id
130. 0.000 0.000 ↓ 0.0 0

Index Scan using fk_pim_empl_position_to_empl on public.pim_employee_position ep (cost=0.29..8.30 rows=1 width=4) (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.employee_id = $43)
131. 0.000 0.000 ↓ 0.0 0

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

  • Output: epr_2.id, epr_2.employee_position_id, epr_2.aud_who, epr_2.aud_when, epr_2.aud_source, epr_2.aud_who_create, epr_2.aud_when_create, epr_2.aud_source_create
  • Index Cond: (epr_2.employee_position_id = ep.id)
132. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=5.49..704.91 rows=82 width=12) (never executed)

  • Output: rgs_2.group_id, rgr_2.group_id, rgr_2.resource_id
133. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on public.sr_res_group_service rgs_2 (cost=4.93..272.12 rows=82 width=4) (never executed)

  • Output: rgs_2.id, rgs_2.bdatetime, rgs_2.edatetime, rgs_2.power, rgs_2.group_id, rgs_2.srv_type_id, rgs_2.moderation_required, rgs_2.patient_multiple_appointment_per_day, rgs_2.referral_required, rgs_2.default_service, rgs_2.aud_who, rgs_2.aud_when, rgs_2.aud_source, rgs_2.aud_who_create, rgs_2.aud_when_create, rgs_2.aud_source_create
  • Recheck Cond: (rgs_2.srv_type_id = ss.id)
134. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on fk_sr_res_group_srv_to_srv (cost=0.00..4.91 rows=82 width=0) (never executed)

  • Index Cond: (rgs_2.srv_type_id = ss.id)
135. 0.000 0.000 ↓ 0.0 0

Index Only Scan using sr_res_group_relationship_resource_id_group_id_ix on public.sr_res_group_relationship rgr_2 (cost=0.56..5.27 rows=1 width=8) (never executed)

  • Output: rgr_2.resource_id, rgr_2.group_id
  • Index Cond: ((rgr_2.resource_id = epr_2.id) AND (rgr_2.group_id = rgs_2.group_id))
  • Heap Fetches: 0
136. 0.000 0.000 ↓ 0.0 0

Index Only Scan using sr_res_group_pk on public.sr_res_group rg_2 (cost=0.56..0.59 rows=1 width=4) (never executed)

  • Output: rg_2.id
  • Index Cond: (rg_2.id = rgr_2.group_id)
  • Heap Fetches: 0
137. 0.000 0.000 ↓ 0.0 0

Index Only Scan using sr_resource_pk on public.sr_resource r_3 (cost=0.29..0.30 rows=1 width=4) (never executed)

  • Output: r_3.id
  • Index Cond: (r_3.id = rgr_2.resource_id)
  • Heap Fetches: 0
138. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=2.40..1,589.06 rows=6 width=4) (never executed)

  • Output: rgs_3.srv_type_id
  • Join Filter: (rgs_3.group_id = rg_3.id)
139.          

Initplan (forNested Loop)

140. 0.000 0.000 ↓ 0.0 0

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

  • Output: employee_id
  • One-Time Filter: false
141. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.84..1,543.81 rows=75 width=12) (never executed)

  • Output: rgs_3.srv_type_id, rgs_3.group_id, rgr_3.group_id
142. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.42..503.49 rows=2,080 width=4) (never executed)

  • Output: rgr_3.group_id
143. 0.000 0.000 ↓ 0.0 0

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

  • Output: r_4.id, epr_3.id
144. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.57..16.62 rows=1 width=4) (never executed)

  • Output: epr_3.id
145. 0.000 0.000 ↓ 0.0 0

Index Scan using fk_pim_empl_position_to_empl on public.pim_employee_position ep_1 (cost=0.29..8.30 rows=1 width=4) (never executed)

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

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

  • Output: epr_3.id, epr_3.employee_position_id, epr_3.aud_who, epr_3.aud_when, epr_3.aud_source, epr_3.aud_who_create, epr_3.aud_when_create, epr_3.aud_source_create
  • Index Cond: (epr_3.employee_position_id = ep_1.id)
147. 0.000 0.000 ↓ 0.0 0

Index Only Scan using sr_resource_pk on public.sr_resource r_4 (cost=0.29..0.35 rows=1 width=4) (never executed)

  • Output: r_4.id
  • Index Cond: (r_4.id = epr_3.id)
  • Heap Fetches: 0
148. 0.000 0.000 ↓ 0.0 0

Index Only Scan using sr_res_group_relationship_resource_id_group_id_ix on public.sr_res_group_relationship rgr_3 (cost=0.56..352.64 rows=13,388 width=8) (never executed)

  • Output: rgr_3.resource_id, rgr_3.group_id
  • Index Cond: (rgr_3.resource_id = r_4.id)
  • Heap Fetches: 0
149. 0.000 0.000 ↓ 0.0 0

Index Scan using fk_sr_res_gr_srv_to_res_gr on public.sr_res_group_service rgs_3 (cost=0.42..0.47 rows=3 width=8) (never executed)

  • Output: rgs_3.id, rgs_3.bdatetime, rgs_3.edatetime, rgs_3.power, rgs_3.group_id, rgs_3.srv_type_id, rgs_3.moderation_required, rgs_3.patient_multiple_appointment_per_day, rgs_3.referral_required, rgs_3.default_service, rgs_3.aud_who, rgs_3.aud_when, rgs_3.aud_source, rgs_3.aud_who_create, rgs_3.aud_when_create, rgs_3.aud_source_create
  • Index Cond: (rgs_3.group_id = rgr_3.group_id)
150. 0.000 0.000 ↓ 0.0 0

Index Only Scan using sr_res_group_pk on public.sr_res_group rg_3 (cost=0.56..0.59 rows=1 width=4) (never executed)

  • Output: rg_3.id
  • Index Cond: (rg_3.id = rgr_3.group_id)
  • Heap Fetches: 0
151. 0.000 0.000 ↓ 0.0 0

Index Only Scan using md_referral_to_service_fk on public.md_referral r_5 (cost=0.42..8.44 rows=1 width=0) (never executed)

  • Index Cond: (r_5.service_id = ssr2.id)
  • Heap Fetches: 0
152. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.md_referral r_6 (cost=0.00..6,144.95 rows=220,295 width=4) (never executed)

  • Output: r_6.service_id
153. 0.000 0.000 ↓ 0.0 0

Seq Scan on disp.md_notification r_7 (cost=0.00..10.25 rows=1 width=0) (never executed)

  • Filter: (r_7.service_id = ssr2.id)
154. 0.000 0.000 ↓ 0.0 0

Seq Scan on disp.md_notification r_8 (cost=0.00..10.20 rows=20 width=4) (never executed)

  • Output: r_8.service_id
155. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=6.30..6.32 rows=1 width=32) (never executed)

  • Output: CASE WHEN (count(service_n2o_form_1.service_code) = 0) THEN 'driverCardServiceFormDefault'::character varying ELSE $61 END
156.          

Initplan (forAggregate)

157. 0.000 0.000 ↓ 0.0 0

Limit (cost=0.00..3.15 rows=1 width=27) (never executed)

  • Output: service_n2o_form.n2o_form
158. 0.000 0.000 ↓ 0.0 0

Seq Scan on disp.service_n2o_form (cost=0.00..3.15 rows=1 width=27) (never executed)

  • Output: service_n2o_form.n2o_form
  • Filter: ((service_n2o_form.service_code)::text = (mnds.code)::text)
159. 0.000 0.000 ↓ 0.0 0

Seq Scan on disp.service_n2o_form service_n2o_form_1 (cost=0.00..3.15 rows=1 width=7) (never executed)

  • Output: service_n2o_form_1.service_code, service_n2o_form_1.n2o_form, service_n2o_form_1.id, service_n2o_form_1.n2o_query, service_n2o_form_1.aud_who, service_n2o_form_1.aud_when, service_n2o_form_1.aud_source, service_n2o_form_1.aud_who_create, service_n2o_form_1.aud_when_create, service_n2o_form_1.aud_source_create
  • Filter: ((service_n2o_form_1.service_code)::text = (mnds.code)::text)
Planning time : 150.505 ms
Execution time : 2.375 ms