explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2fmj

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 8,834.479 ↑ 11.0 1 1

Limit (cost=2.85..273.79 rows=11 width=1,166) (actual time=8,827.862..8,834.479 rows=1 loops=1)

  • Output: step.id, (((step.outcome_date IS NULL) OR (step.outcome_date > ('now'::cstring)::date))), mc.uid, mc.id, (concat_ws(' '::text, pi.surname, pi.name, pi.patr_name)), pi.id, mct.id, mct.name, mct.code, (concat_ws(' '::text, indiv.surname, indiv.name (...)
  • Buffers: shared hit=1,707,875
2. 0.027 8,834.477 ↑ 15,621.0 1 1

Nested Loop Left Join (cost=2.85..384,772.26 rows=15,621 width=1,166) (actual time=8,827.860..8,834.477 rows=1 loops=1)

  • Output: step.id, ((step.outcome_date IS NULL) OR (step.outcome_date > ('now'::cstring)::date)), mc.uid, mc.id, concat_ws(' '::text, pi.surname, pi.name, pi.patr_name), pi.id, mct.id, mct.name, mct.code, concat_ws(' '::text, indiv.surname, indiv.nam (...)
  • Buffers: shared hit=1,707,875
3. 0.005 8,834.432 ↑ 15,621.0 1 1

Nested Loop Left Join (cost=2.56..249,380.38 rows=15,621 width=1,165) (actual time=8,827.816..8,834.432 rows=1 loops=1)

  • Output: step.id, step.outcome_date, step.admission_date, mc.uid, mc.id, pi.surname, pi.name, pi.patr_name, pi.id, mct.id, mct.name, mct.code, indiv.surname, indiv.name, indiv.patr_name, mcd.diagnos_id
  • Buffers: shared hit=1,707,869
4. 0.003 8,834.419 ↑ 15,621.0 1 1

Nested Loop Left Join (cost=2.27..243,245.29 rows=15,621 width=1,165) (actual time=8,827.804..8,834.419 rows=1 loops=1)

  • Output: step.id, step.outcome_date, step.admission_date, mc.uid, mc.id, mc.main_diagnos_id, pi.surname, pi.name, pi.patr_name, pi.id, mct.id, mct.name, mct.code, indiv.surname, indiv.name, indiv.patr_name
  • Buffers: shared hit=1,707,866
5. 0.005 8,834.408 ↑ 15,621.0 1 1

Nested Loop Left Join (cost=1.85..153,073.07 rows=15,621 width=1,119) (actual time=8,827.794..8,834.408 rows=1 loops=1)

  • Output: step.id, step.outcome_date, step.admission_date, mc.uid, mc.id, mc.main_diagnos_id, pi.surname, pi.name, pi.patr_name, pi.id, mct.id, mct.name, mct.code, empl.individual_id
  • Buffers: shared hit=1,707,862
6. 0.006 8,834.394 ↑ 15,621.0 1 1

Nested Loop Left Join (cost=1.56..144,392.20 rows=15,621 width=1,119) (actual time=8,827.780..8,834.394 rows=1 loops=1)

  • Output: step.id, step.outcome_date, step.admission_date, mc.uid, mc.id, mc.main_diagnos_id, pi.surname, pi.name, pi.patr_name, pi.id, mct.id, mct.name, mct.code, empl_posit.employee_id
  • Buffers: shared hit=1,707,859
7. 0.003 8,834.376 ↑ 15,621.0 1 1

Nested Loop Left Join (cost=1.28..139,583.94 rows=15,621 width=1,119) (actual time=8,827.764..8,834.376 rows=1 loops=1)

  • Output: step.id, step.outcome_date, step.admission_date, mc.uid, mc.id, mc.main_diagnos_id, pi.surname, pi.name, pi.patr_name, pi.id, mct.id, mct.name, mct.code, res_group.responsible_id
  • Buffers: shared hit=1,707,856
8. 0.004 8,834.362 ↑ 15,621.0 1 1

Nested Loop Left Join (cost=0.86..102,038.49 rows=15,621 width=1,119) (actual time=8,827.751..8,834.362 rows=1 loops=1)

  • Output: step.id, step.outcome_date, step.admission_date, step.res_group_id, mc.uid, mc.id, mc.main_diagnos_id, pi.surname, pi.name, pi.patr_name, pi.id, mct.id, mct.name, mct.code
  • Buffers: shared hit=1,707,852
9. 0.006 8,834.353 ↑ 15,621.0 1 1

Nested Loop Left Join (cost=0.72..99,403.60 rows=15,621 width=87) (actual time=8,827.743..8,834.353 rows=1 loops=1)

  • Output: step.id, step.outcome_date, step.admission_date, step.res_group_id, mc.uid, mc.id, mc.case_type_id, mc.main_diagnos_id, pi.surname, pi.name, pi.patr_name, pi.id
  • Buffers: shared hit=1,707,850
10. 0.005 8,834.336 ↑ 15,621.0 1 1

Nested Loop Left Join (cost=0.29..21,328.05 rows=15,621 width=37) (actual time=8,827.726..8,834.336 rows=1 loops=1)

  • Output: step.id, step.outcome_date, step.admission_date, step._patient_id, step.res_group_id, mc.uid, mc.id, mc.case_type_id, mc.main_diagnos_id
  • Buffers: shared hit=1,707,846
11. 8,834.319 8,834.319 ↑ 15,621.0 1 1

Seq Scan on public.mc_step step (cost=0.00..12,872.38 rows=15,621 width=24) (actual time=8,827.711..8,834.319 rows=1 loops=1)

  • Output: step.id, step.admission_date, step.admission_time, step.death_date, step.death_time, step.outcome_date, step.outcome_time, step.death_employee_id, step.main_diagnosis_id, step.case_id, s (...)
  • Filter: is_physio_step(step.id)
  • Rows Removed by Filter: 46,871
  • Buffers: shared hit=1,707,843
12. 0.012 0.012 ↑ 1.0 1 1

Index Scan using mc_case_pkey on public.mc_case mc (cost=0.29..0.53 rows=1 width=17) (actual time=0.011..0.012 rows=1 loops=1)

  • Output: mc.uid, mc.id, mc.case_type_id, mc.main_diagnos_id
  • Index Cond: (mc.id = step.case_id)
  • Buffers: shared hit=3
13. 0.011 0.011 ↑ 1.0 1 1

Index Scan using pim_individual_pkey on public.pim_individual pi (cost=0.43..4.99 rows=1 width=54) (actual time=0.011..0.011 rows=1 loops=1)

  • Output: pi.birth_dt, pi.death_dt, pi.has_citizenship, pi.name, pi.patr_name, pi.surname, pi.id, pi.gender_id, pi.nationality_id, pi.list_identity_doc, pi.list_oms_doc, pi.list_job_org, pi.list_reg_nam (...)
  • Index Cond: (pi.id = step._patient_id)
  • Buffers: shared hit=4
14. 0.005 0.005 ↑ 1.0 1 1

Index Scan using mc_case_type_pkey on public.mc_case_type mct (cost=0.14..0.16 rows=1 width=1,036) (actual time=0.004..0.005 rows=1 loops=1)

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

Index Scan using sr_res_group_pkey on public.sr_res_group res_group (cost=0.42..2.39 rows=1 width=8) (actual time=0.010..0.011 rows=1 loops=1)

  • Output: res_group.id, res_group.bdate, res_group.edate, res_group.is_system, res_group.name, res_group.org_id, res_group.department_id, res_group.responsible_id, res_group.is_available_in_electronic_queue, res_gr (...)
  • Index Cond: (res_group.id = step.res_group_id)
  • Buffers: shared hit=4
16. 0.012 0.012 ↑ 1.0 1 1

Index Scan using pim_employee_position_pkey on public.pim_employee_position empl_posit (cost=0.28..0.30 rows=1 width=8) (actual time=0.012..0.012 rows=1 loops=1)

  • Output: empl_posit.id, empl_posit.dismissal_order_code, empl_posit.start_date, empl_posit.hiring_order_code, empl_posit.rate, empl_posit.end_date, empl_posit.dismissal_reason_id, empl_posit.employee_id, empl_posit.empl (...)
  • Index Cond: (empl_posit.id = res_group.responsible_id)
  • Buffers: shared hit=3
17. 0.009 0.009 ↑ 1.0 1 1

Index Scan using pim_employee_pkey on public.pim_employee empl (cost=0.29..0.55 rows=1 width=8) (actual time=0.009..0.009 rows=1 loops=1)

  • Output: empl.id, empl.note, empl.number, empl.photo, empl.callup_subject_id, empl.individual_id, empl.organization_id, empl.is_dismissed, empl.employment_dt, empl.dismissal_dt, empl.aud_who, empl.aud_when, empl.aud_source, e (...)
  • Index Cond: (empl.id = empl_posit.employee_id)
  • Buffers: shared hit=3
18. 0.008 0.008 ↑ 1.0 1 1

Index Scan using pim_individual_pkey on public.pim_individual indiv (cost=0.43..5.76 rows=1 width=54) (actual time=0.007..0.008 rows=1 loops=1)

  • Output: indiv.birth_dt, indiv.death_dt, indiv.has_citizenship, indiv.name, indiv.patr_name, indiv.surname, indiv.id, indiv.gender_id, indiv.nationality_id, indiv.list_identity_doc, indiv.list_oms_doc, indiv.list_job_org, indiv.lis (...)
  • Index Cond: (indiv.id = empl.individual_id)
  • Buffers: shared hit=4
19. 0.008 0.008 ↑ 1.0 1 1

Index Scan using mc_diagnosis_pkey on public.mc_diagnosis mcd (cost=0.29..0.38 rows=1 width=8) (actual time=0.008..0.008 rows=1 loops=1)

  • Output: mcd.id, mcd.establishment_date, mcd.note, mcd.diagnos_id, mcd.disease_type_id, mcd.doctor_id, mcd.injury_type_id, mcd.case_id, mcd.patient_id, mcd.stage_id, mcd.step_id, mcd.type_id, mcd.is_main, mcd.is_suspicion, mcd.mes_id, mc (...)
  • Index Cond: (mcd.id = mc.main_diagnos_id)
  • Buffers: shared hit=3
20. 0.010 0.010 ↑ 1.0 1 1

Index Scan using md_diagnosis_pkey on public.md_diagnosis mdd (cost=0.29..0.33 rows=1 width=525) (actual time=0.010..0.010 rows=1 loops=1)

  • Output: mdd.id, mdd.code, mdd.name, mdd.parent_id, mdd.is_injury, mdd.level, mdd.is_leaf, mdd.e_code, mdd.from_dt, mdd.to_dt, mdd.oms, mdd.stomat, mdd.aud_who, mdd.aud_when, mdd.aud_source, mdd.aud_who_create, mdd.aud_when_create, mdd.aud_sou (...)
  • Index Cond: (mdd.id = mcd.diagnos_id)
  • Buffers: shared hit=3
21.          

SubPlan (for Nested Loop Left Join)

22. 0.003 0.008 ↑ 1.0 1 1

Limit (cost=0.29..8.31 rows=1 width=4) (actual time=0.007..0.008 rows=1 loops=1)

  • Output: msr.id
  • Buffers: shared hit=3
23. 0.005 0.005 ↑ 1.0 1 1

Index Only Scan using md_srv_rendered_step_id_id_idx on public.md_srv_rendered msr (cost=0.29..8.31 rows=1 width=4) (actual time=0.005..0.005 rows=1 loops=1)

  • Output: msr.id
  • Index Cond: (msr.step_id = step.id)
  • Heap Fetches: 1
  • Buffers: shared hit=3
Planning time : 5.126 ms
Execution time : 8,834.869 ms