explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2Dn9

Settings
# exclusive inclusive rows x rows loops node
1. 0.021 77,728.510 ↑ 1.0 20 1

Limit (cost=23,647,482.58..23,647,482.63 rows=20 width=597) (actual time=77,728.483..77,728.510 rows=20 loops=1)

  • Output: visit0_.id, visit0_1_.admission_date, caseinitgo9_.name, caseinitgo9_.id, medicalcas13_.uid, medicalcas13_.open_date, diagnosis12_.name, diagnosis12_.code, casediagno10_.note, individual4_.surname, individual4_.name, individual4_.patr_name, (get_visit_services_names(visit0_.id)), careregime7_.code, organizati6_.short_name, individual16_.id, individual16_.name, individual16_.surname, individual16_.patr_name, medicalpro8_.name, casestate14_.name, visit0_1_._clinic_id, employee3_.id, medicalcas13_.closing_step_id, diseasetyp11_.name, ((SubPlan 1)), (get_patient_active_address(individual16_.id)), (get_individual_surname_index(visit0_1_._patient_id)), (get_individual_name_index(visit0_1_._patient_id)), (get_individual_patr_name_index(visit0_1_._patient_id)), visit0_1_.id
  • Buffers: shared hit=345,256 read=7,822 dirtied=2
  • I/O Timings: read=74,842.451
2. 52.909 77,728.489 ↑ 107.3 20 1

Sort (cost=23,647,482.58..23,647,487.94 rows=2,147 width=597) (actual time=77,728.474..77,728.489 rows=20 loops=1)

  • Output: visit0_.id, visit0_1_.admission_date, caseinitgo9_.name, caseinitgo9_.id, medicalcas13_.uid, medicalcas13_.open_date, diagnosis12_.name, diagnosis12_.code, casediagno10_.note, individual4_.surname, individual4_.name, individual4_.patr_name, (get_visit_services_names(visit0_.id)), careregime7_.code, organizati6_.short_name, individual16_.id, individual16_.name, individual16_.surname, individual16_.patr_name, medicalpro8_.name, casestate14_.name, visit0_1_._clinic_id, employee3_.id, medicalcas13_.closing_step_id, diseasetyp11_.name, ((SubPlan 1)), (get_patient_active_address(individual16_.id)), (get_individual_surname_index(visit0_1_._patient_id)), (get_individual_name_index(visit0_1_._patient_id)), (get_individual_patr_name_index(visit0_1_._patient_id)), visit0_1_.id
  • Sort Key: (get_individual_surname_index(visit0_1_._patient_id)), (get_individual_name_index(visit0_1_._patient_id)), (get_individual_patr_name_index(visit0_1_._patient_id)), visit0_.id DESC
  • Sort Method: top-N heapsort Memory: 45kB
  • Buffers: shared hit=345,256 read=7,822 dirtied=2
  • I/O Timings: read=74,842.451
3. 18,260.720 77,675.580 ↑ 4.7 461 1

Nested Loop (cost=16,530.94..23,647,425.45 rows=2,147 width=597) (actual time=7,575.486..77,675.580 rows=461 loops=1)

  • Output: visit0_.id, visit0_1_.admission_date, caseinitgo9_.name, caseinitgo9_.id, medicalcas13_.uid, medicalcas13_.open_date, diagnosis12_.name, diagnosis12_.code, casediagno10_.note, individual4_.surname, individual4_.name, individual4_.patr_name, get_visit_services_names(visit0_.id), careregime7_.code, organizati6_.short_name, individual16_.id, individual16_.name, individual16_.surname, individual16_.patr_name, medicalpro8_.name, casestate14_.name, visit0_1_._clinic_id, employee3_.id, medicalcas13_.closing_step_id, diseasetyp11_.name, (SubPlan 1), get_patient_active_address(individual16_.id), get_individual_surname_index(visit0_1_._patient_id), get_individual_name_index(visit0_1_._patient_id), get_individual_patr_name_index(visit0_1_._patient_id), visit0_1_.id
  • Buffers: shared hit=345,250 read=7,822 dirtied=2
  • I/O Timings: read=74,842.451
4. 2.945 51,377.325 ↑ 4.7 461 1

Nested Loop Left Join (cost=16,530.50..147,253.84 rows=2,147 width=601) (actual time=5,179.766..51,377.325 rows=461 loops=1)

  • Output: visit0_.id, visit0_1_.admission_date, visit0_1_._clinic_id, visit0_1_._patient_id, visit0_1_.id, visit0_1_.case_id, employee3_.id, individual4_.surname, individual4_.name, individual4_.patr_name, organizati6_.short_name, careregime7_.code, medicalpro8_.name, caseinitgo9_.name, caseinitgo9_.id, casediagno10_.note, diseasetyp11_.name, diagnosis12_.name, diagnosis12_.code, medicalcas13_.uid, medicalcas13_.open_date, medicalcas13_.closing_step_id, casestate14_.name, individual16_.id, individual16_.name, individual16_.surname, individual16_.patr_name
  • Buffers: shared hit=292,115 read=6,414
  • I/O Timings: read=49,258.811
5. 4.006 47,629.677 ↑ 4.7 461 1

Nested Loop (cost=16,530.07..133,027.77 rows=2,147 width=551) (actual time=5,125.576..47,629.677 rows=461 loops=1)

  • Output: visit0_.id, visit0_1_.admission_date, visit0_1_._clinic_id, visit0_1_._patient_id, visit0_1_.id, visit0_1_.case_id, employee3_.id, individual4_.surname, individual4_.name, individual4_.patr_name, organizati6_.short_name, careregime7_.code, medicalpro8_.name, caseinitgo9_.name, caseinitgo9_.id, casediagno10_.note, diseasetyp11_.name, diagnosis12_.name, diagnosis12_.code, medicalcas13_.uid, medicalcas13_.open_date, medicalcas13_.closing_step_id, casestate14_.name, patient15_.id
  • Buffers: shared hit=290,461 read=6,224
  • I/O Timings: read=45,522.437
6. 5.468 44,569.702 ↑ 4.7 461 1

Nested Loop Left Join (cost=16,529.64..116,380.89 rows=2,147 width=547) (actual time=5,053.834..44,569.702 rows=461 loops=1)

  • Output: visit0_.id, visit0_1_.admission_date, visit0_1_._clinic_id, visit0_1_._patient_id, visit0_1_.id, visit0_1_.case_id, employee3_.id, individual4_.surname, individual4_.name, individual4_.patr_name, organizati6_.short_name, careregime7_.code, medicalpro8_.name, caseinitgo9_.name, caseinitgo9_.id, casediagno10_.note, diseasetyp11_.name, diagnosis12_.name, diagnosis12_.code, medicalcas13_.uid, medicalcas13_.open_date, medicalcas13_.closing_step_id, casestate14_.name
  • Join Filter: (medicalcas13_.state_id = casestate14_.id)
  • Rows Removed by Join Filter: 3,231
  • Buffers: shared hit=288,809 read=6,032
  • I/O Timings: read=42,478.120
7. 3.801 44,561.929 ↑ 4.7 461 1

Nested Loop Left Join (cost=16,529.64..116,122.15 rows=2,147 width=513) (actual time=5,053.778..44,561.929 rows=461 loops=1)

  • Output: visit0_.id, visit0_1_.admission_date, visit0_1_._clinic_id, visit0_1_._patient_id, visit0_1_.id, visit0_1_.case_id, employee3_.id, individual4_.surname, individual4_.name, individual4_.patr_name, organizati6_.short_name, careregime7_.code, medicalpro8_.name, caseinitgo9_.name, caseinitgo9_.id, casediagno10_.note, diseasetyp11_.name, diagnosis12_.name, diagnosis12_.code, medicalcas13_.uid, medicalcas13_.open_date, medicalcas13_.closing_step_id, medicalcas13_.state_id
  • Buffers: shared hit=288,808 read=6,032
  • I/O Timings: read=42,478.120
8. 2.990 38,438.353 ↑ 4.7 461 1

Hash Left Join (cost=16,529.21..98,063.19 rows=2,147 width=494) (actual time=4,889.868..38,438.353 rows=461 loops=1)

  • Output: visit0_.id, visit0_1_.admission_date, visit0_1_._clinic_id, visit0_1_._patient_id, visit0_1_.id, visit0_1_.case_id, employee3_.id, individual4_.surname, individual4_.name, individual4_.patr_name, organizati6_.short_name, careregime7_.code, medicalpro8_.name, caseinitgo9_.name, caseinitgo9_.id, casediagno10_.note, diseasetyp11_.name, diagnosis12_.name, diagnosis12_.code
  • Hash Cond: (casediagno10_.diagnos_id = diagnosis12_.id)
  • Buffers: shared hit=287,412 read=5,581
  • I/O Timings: read=36,373.822
9. 4.800 36,776.665 ↑ 4.7 461 1

Nested Loop Left Join (cost=14,676.57..96,181.03 rows=2,147 width=376) (actual time=3,231.024..36,776.665 rows=461 loops=1)

  • Output: visit0_.id, visit0_1_.admission_date, visit0_1_._clinic_id, visit0_1_._patient_id, visit0_1_.id, visit0_1_.case_id, employee3_.id, individual4_.surname, individual4_.name, individual4_.patr_name, organizati6_.short_name, careregime7_.code, medicalpro8_.name, caseinitgo9_.name, caseinitgo9_.id, casediagno10_.note, casediagno10_.diagnos_id, diseasetyp11_.name
  • Join Filter: (casediagno10_.disease_type_id = diseasetyp11_.id)
  • Rows Removed by Join Filter: 2,305
  • Buffers: shared hit=286,369 read=5,140
  • I/O Timings: read=34,753.263
10. 2.608 36,769.560 ↑ 4.7 461 1

Nested Loop Left Join (cost=14,676.57..95,986.73 rows=2,147 width=329) (actual time=3,230.962..36,769.560 rows=461 loops=1)

  • Output: visit0_.id, visit0_1_.admission_date, visit0_1_._clinic_id, visit0_1_._patient_id, visit0_1_.id, visit0_1_.case_id, employee3_.id, individual4_.surname, individual4_.name, individual4_.patr_name, organizati6_.short_name, careregime7_.code, medicalpro8_.name, caseinitgo9_.name, caseinitgo9_.id, casediagno10_.note, casediagno10_.disease_type_id, casediagno10_.diagnos_id
  • Buffers: shared hit=286,368 read=5,140
  • I/O Timings: read=34,753.263
11. 1.779 28,654.274 ↑ 4.7 461 1

Hash Left Join (cost=14,676.00..77,594.47 rows=2,147 width=318) (actual time=1,895.554..28,654.274 rows=461 loops=1)

  • Output: visit0_.id, visit0_1_.admission_date, visit0_1_._clinic_id, visit0_1_._patient_id, visit0_1_.id, visit0_1_.main_diagnosis_id, visit0_1_.case_id, employee3_.id, individual4_.surname, individual4_.name, individual4_.patr_name, organizati6_.short_name, careregime7_.code, medicalpro8_.name, caseinitgo9_.name, caseinitgo9_.id
  • Hash Cond: (visit0_.goal_id = caseinitgo9_.id)
  • Buffers: shared hit=284,644 read=4,556
  • I/O Timings: read=26,654.061
12. 1.851 28,440.564 ↑ 4.7 461 1

Hash Left Join (cost=14,670.58..77,559.53 rows=2,147 width=202) (actual time=1,683.553..28,440.564 rows=461 loops=1)

  • Output: visit0_.id, visit0_.goal_id, visit0_1_.admission_date, visit0_1_._clinic_id, visit0_1_._patient_id, visit0_1_.id, visit0_1_.main_diagnosis_id, visit0_1_.case_id, employee3_.id, individual4_.surname, individual4_.name, individual4_.patr_name, organizati6_.short_name, careregime7_.code, medicalpro8_.name
  • Hash Cond: (visit0_1_.profile_id = medicalpro8_.id)
  • Buffers: shared hit=284,643 read=4,553
  • I/O Timings: read=26,442.382
13. 3.882 28,198.881 ↑ 4.7 461 1

Nested Loop Left Join (cost=14,659.83..77,519.28 rows=2,147 width=143) (actual time=1,443.652..28,198.881 rows=461 loops=1)

  • Output: visit0_.id, visit0_.goal_id, visit0_1_.admission_date, visit0_1_._clinic_id, visit0_1_._patient_id, visit0_1_.id, visit0_1_.profile_id, visit0_1_.main_diagnosis_id, visit0_1_.case_id, employee3_.id, individual4_.surname, individual4_.name, individual4_.patr_name, organizati6_.short_name, careregime7_.code
  • Join Filter: (visit0_1_.regimen_id = careregime7_.id)
  • Rows Removed by Join Filter: 3,235
  • Buffers: shared hit=284,641 read=4,548
  • I/O Timings: read=26,203.003
14. 2.225 28,192.694 ↑ 4.7 461 1

Nested Loop Left Join (cost=14,659.83..77,260.54 rows=2,147 width=143) (actual time=1,443.608..28,192.694 rows=461 loops=1)

  • Output: visit0_.id, visit0_.goal_id, visit0_1_.admission_date, visit0_1_._clinic_id, visit0_1_._patient_id, visit0_1_.id, visit0_1_.regimen_id, visit0_1_.profile_id, visit0_1_.main_diagnosis_id, visit0_1_.case_id, employee3_.id, individual4_.surname, individual4_.name, individual4_.patr_name, organizati6_.short_name
  • Join Filter: (clinic5_.id = organizati6_.id)
  • Buffers: shared hit=284,640 read=4,548
  • I/O Timings: read=26,203.003
15. 2.655 27,934.153 ↑ 4.7 461 1

Nested Loop Left Join (cost=14,659.54..77,220.03 rows=2,147 width=98) (actual time=1,187.979..27,934.153 rows=461 loops=1)

  • Output: visit0_.id, visit0_.goal_id, visit0_1_.admission_date, visit0_1_._clinic_id, visit0_1_._patient_id, visit0_1_.id, visit0_1_.regimen_id, visit0_1_.profile_id, visit0_1_.main_diagnosis_id, visit0_1_.case_id, employee3_.id, individual4_.surname, individual4_.name, individual4_.patr_name, clinic5_.id
  • Join Filter: (visit0_1_._clinic_id = clinic5_.id)
  • Buffers: shared hit=284,639 read=4,546
  • I/O Timings: read=25,947.463
16. 2.744 27,849.440 ↑ 4.7 461 1

Nested Loop Left Join (cost=14,659.25..77,179.52 rows=2,147 width=94) (actual time=1,106.549..27,849.440 rows=461 loops=1)

  • Output: visit0_.id, visit0_.goal_id, visit0_1_.admission_date, visit0_1_._clinic_id, visit0_1_._patient_id, visit0_1_.id, visit0_1_.regimen_id, visit0_1_.profile_id, visit0_1_.main_diagnosis_id, visit0_1_.case_id, employee3_.id, individual4_.surname, individual4_.name, individual4_.patr_name
  • Buffers: shared hit=284,637 read=4,544
  • I/O Timings: read=25,881.723
17. 2.187 27,644.778 ↑ 4.7 461 1

Hash Left Join (cost=14,658.82..62,045.40 rows=2,147 width=48) (actual time=1,069.151..27,644.778 rows=461 loops=1)

  • Output: visit0_.id, visit0_.goal_id, visit0_1_.admission_date, visit0_1_._clinic_id, visit0_1_._patient_id, visit0_1_.id, visit0_1_.regimen_id, visit0_1_.profile_id, visit0_1_.main_diagnosis_id, visit0_1_.case_id, employee3_.id, employee3_.individual_id
  • Hash Cond: (employeeto2_.employee_id = employee3_.id)
  • Buffers: shared hit=282,804 read=4,533
  • I/O Timings: read=25,686.255
18. 2.823 27,572.712 ↑ 4.7 461 1

Hash Left Join (cost=13,614.57..60,971.62 rows=2,147 width=44) (actual time=999.204..27,572.712 rows=461 loops=1)

  • Output: visit0_.id, visit0_.goal_id, visit0_1_.admission_date, visit0_1_._clinic_id, visit0_1_._patient_id, visit0_1_.id, visit0_1_.regimen_id, visit0_1_.profile_id, visit0_1_.main_diagnosis_id, visit0_1_.case_id, employeeto2_.employee_id
  • Hash Cond: (resourcegr1_.responsible_id = employeeto2_.id)
  • Buffers: shared hit=282,800 read=4,129
  • I/O Timings: read=25,650.902
19. 3.591 27,393.189 ↑ 4.7 461 1

Nested Loop Left Join (cost=11,874.65..59,202.31 rows=2,147 width=44) (actual time=822.404..27,393.189 rows=461 loops=1)

  • Output: visit0_.id, visit0_.goal_id, visit0_1_.admission_date, visit0_1_._clinic_id, visit0_1_._patient_id, visit0_1_.id, visit0_1_.regimen_id, visit0_1_.profile_id, visit0_1_.main_diagnosis_id, visit0_1_.case_id, resourcegr1_.responsible_id
  • Buffers: shared hit=282,726 read=3,472
  • I/O Timings: read=25,531.533
20. 4.493 26,143.976 ↑ 4.7 461 1

Nested Loop (cost=11,874.08..40,774.90 rows=2,147 width=44) (actual time=822.361..26,143.976 rows=461 loops=1)

  • Output: visit0_.id, visit0_.goal_id, visit0_1_.admission_date, visit0_1_._clinic_id, visit0_1_._patient_id, visit0_1_.id, visit0_1_.res_group_id, visit0_1_.regimen_id, visit0_1_.profile_id, visit0_1_.main_diagnosis_id, visit0_1_.case_id
  • Buffers: shared hit=280,516 read=3,375
  • I/O Timings: read=24,293.514
21. 19,572.867 20,148.327 ↑ 5.0 461 1

Bitmap Heap Scan on public.mc_step visit0_1_ (cost=11,873.64..21,364.38 rows=2,307 width=36) (actual time=705.500..20,148.327 rows=461 loops=1)

  • Output: visit0_1_.id, visit0_1_.admission_date, visit0_1_.admission_time, visit0_1_.death_date, visit0_1_.death_time, visit0_1_.outcome_date, visit0_1_.outcome_time, visit0_1_.death_employee_id, visit0_1_.main_diagnosis_id, visit0_1_.case_id, visit0_1_.outcome_id, visit0_1_.outcome_clinic_id, visit0_1_.outcome_regimen_id, visit0_1_.regimen_id, visit0_1_.res_group_id, visit0_1_.result_id, visit0_1_.reason_id, visit0_1_.profile_id, visit0_1_.mes_id, visit0_1_.mes_quality_criterion_id, visit0_1_.is_continue, visit0_1_.is_continue_editable, visit0_1_.standard_id, visit0_1_.csg_id, visit0_1_.vmp_type_id, visit0_1_.vmp_method_id, visit0_1_.deviation_reason_id, visit0_1_.aud_who, visit0_1_.aud_when, visit0_1_.aud_source, visit0_1_.aud_who_create, visit0_1_.aud_when_create, visit0_1_.aud_source_create, visit0_1_._clinic_id, visit0_1_._patient_id, visit0_1_._case_mode_id, visit0_1_._is_last, visit0_1_._responsible_id, visit0_1_._department_id, visit0_1_.hsp_bed_days_amount, visit0_1_.hsp_bed_profile_id, visit0_1_.hsp_complexity_level_id, visit0_1_.hsp_days_comp_algo_id, visit0_1_.hsp_department_id, visit0_1_.hsp_funding_id, visit0_1_.hsp_is_admission_day_counts, visit0_1_.hsp_is_diag_not_eq, visit0_1_.hsp_is_set_diagnosis, visit0_1_.hsp_issue_planned_date, visit0_1_.hsp_mes_id, visit0_1_.hsp_missed_days_amount, visit0_1_.hsp_plan_department_id, visit0_1_.hsp_previous_id, visit0_1_.hsp_refusal_employee_id, visit0_1_.plc_goal_id, visit0_1_.plc_initiator_id, visit0_1_.plc_is_needed, visit0_1_.plc_is_sanitized, visit0_1_.plc_is_viewed, visit0_1_.plc_place_id, visit0_1_.plc_type_id, visit0_1_.plc_appointment_id, visit0_1_.plc_planned_date, visit0_1_.is_autopsy, visit0_1_.planned_date_closing_case, visit0_1_.gestational_age, visit0_1_.onko_stage, visit0_1_.is_first_step
  • Recheck Cond: ((get_visit_deps(visit0_1_.id) ~~ '%3623%'::text) AND (visit0_1_._clinic_id = 5,028) AND (visit0_1_.admission_date >= '2019-01-01'::date) AND (visit0_1_.admission_date <= '2019-12-27'::date))
  • Heap Blocks: exact=456
  • Buffers: shared hit=279,149 read=2,895
  • I/O Timings: read=18,314.839
22. 0.887 575.460 ↓ 0.0 0 1

BitmapAnd (cost=11,873.64..11,873.64 rows=2,307 width=0) (actual time=575.460..575.460 rows=0 loops=1)

  • Buffers: shared hit=38 read=1,028
  • I/O Timings: read=478.739
23. 1.148 1.148 ↑ 240.6 1,267 1

Bitmap Index Scan on visit_deps_gin_idx (cost=0.00..2,750.29 rows=304,839 width=0) (actual time=1.148..1.148 rows=1,267 loops=1)

  • Index Cond: (get_visit_deps(visit0_1_.id) ~~ '%3623%'::text)
  • Buffers: shared hit=38
24. 573.425 573.425 ↑ 1.1 266,816 1

Bitmap Index Scan on mc_step__clinic_id_admission_date_outcome_date_ix (cost=0.00..9,121.94 rows=288,430 width=0) (actual time=573.425..573.425 rows=266,816 loops=1)

  • Index Cond: ((visit0_1_._clinic_id = 5,028) AND (visit0_1_.admission_date >= '2019-01-01'::date) AND (visit0_1_.admission_date <= '2019-12-27'::date))
  • Buffers: shared read=1,028
  • I/O Timings: read=478.739
25. 5,991.156 5,991.156 ↑ 1.0 1 461

Index Scan using plc_visit_pk on public.plc_visit visit0_ (cost=0.44..8.40 rows=1 width=8) (actual time=12.942..12.996 rows=1 loops=461)

  • Output: visit0_.id, visit0_.duration, visit0_.goal_id, visit0_.initiator_id, visit0_.place_id, visit0_.type_id, visit0_.is_viewed, visit0_.is_needed, visit0_.is_sanitized, visit0_.aud_who, visit0_.aud_when, visit0_.aud_source, visit0_.aud_who_create, visit0_.aud_when_create, visit0_.aud_source_create, visit0_.planned_date, visit0_.appointment_id, visit0_.dental_formula_id
  • Index Cond: (visit0_.id = visit0_1_.id)
  • Buffers: shared hit=1,367 read=480
  • I/O Timings: read=5,978.675
26. 1,245.622 1,245.622 ↑ 1.0 1 461

Index Scan using sr_res_group_pk on public.sr_res_group resourcegr1_ (cost=0.57..8.57 rows=1 width=8) (actual time=2.701..2.702 rows=1 loops=461)

  • Output: resourcegr1_.id, resourcegr1_.bdate, resourcegr1_.edate, resourcegr1_.is_system, resourcegr1_.name, resourcegr1_.department_id, resourcegr1_.org_id, resourcegr1_.responsible_id, resourcegr1_.is_available_in_electronic_queue, resourcegr1_.label_id, resourcegr1_.ignore_regclinic_check, resourcegr1_.note, resourcegr1_.blocked, resourcegr1_.block_comment, resourcegr1_.template_res_group_id, resourcegr1_.aud_who, resourcegr1_.aud_when, resourcegr1_.aud_source, resourcegr1_.aud_who_create, resourcegr1_.aud_when_create, resourcegr1_.aud_source_create, resourcegr1_.emergency, resourcegr1_.ignore_districts, resourcegr1_.service_template_id
  • Index Cond: (visit0_1_.res_group_id = resourcegr1_.id)
  • Buffers: shared hit=2,210 read=97
  • I/O Timings: read=1,238.019
27. 26.851 176.700 ↑ 1.0 44,841 1

Hash (cost=1,179.41..1,179.41 rows=44,841 width=8) (actual time=176.700..176.700 rows=44,841 loops=1)

  • Output: employeeto2_.id, employeeto2_.employee_id
  • Buckets: 65,536 Batches: 1 Memory Usage: 2,264kB
  • Buffers: shared hit=74 read=657
  • I/O Timings: read=119.369
28. 149.849 149.849 ↑ 1.0 44,841 1

Seq Scan on public.pim_employee_position employeeto2_ (cost=0.00..1,179.41 rows=44,841 width=8) (actual time=28.388..149.849 rows=44,841 loops=1)

  • Output: employeeto2_.id, employeeto2_.employee_id
  • Buffers: shared hit=74 read=657
  • I/O Timings: read=119.369
29. 16.759 69.879 ↓ 1.0 28,536 1

Hash (cost=690.78..690.78 rows=28,278 width=8) (actual time=69.879..69.879 rows=28,536 loops=1)

  • Output: employee3_.id, employee3_.individual_id
  • Buckets: 32,768 Batches: 1 Memory Usage: 1,371kB
  • Buffers: shared hit=4 read=404
  • I/O Timings: read=35.353
30. 53.120 53.120 ↓ 1.0 28,536 1

Seq Scan on public.pim_employee employee3_ (cost=0.00..690.78 rows=28,278 width=8) (actual time=0.008..53.120 rows=28,536 loops=1)

  • Output: employee3_.id, employee3_.individual_id
  • Buffers: shared hit=4 read=404
  • I/O Timings: read=35.353
31. 201.918 201.918 ↑ 1.0 1 461

Index Scan using pim_individual_pk on public.pim_individual individual4_ (cost=0.43..7.04 rows=1 width=54) (actual time=0.437..0.438 rows=1 loops=461)

  • Output: individual4_.surname, individual4_.name, individual4_.patr_name, individual4_.id
  • Index Cond: (employee3_.individual_id = individual4_.id)
  • Buffers: shared hit=1,833 read=11
  • I/O Timings: read=195.468
32. 0.671 82.058 ↑ 1.0 1 461

Materialize (cost=0.29..8.31 rows=1 width=4) (actual time=0.178..0.178 rows=1 loops=461)

  • Output: clinic5_.id
  • Buffers: shared hit=2 read=2
  • I/O Timings: read=65.740
33. 81.387 81.387 ↑ 1.0 1 1

Index Only Scan using md_clinic_pk on public.md_clinic clinic5_ (cost=0.29..8.30 rows=1 width=4) (actual time=81.385..81.387 rows=1 loops=1)

  • Output: clinic5_.id
  • Index Cond: (clinic5_.id = 5,028)
  • Heap Fetches: 1
  • Buffers: shared hit=2 read=2
  • I/O Timings: read=65.740
34. 0.723 256.316 ↑ 1.0 1 461

Materialize (cost=0.29..8.31 rows=1 width=53) (actual time=0.555..0.556 rows=1 loops=461)

  • Output: organizati6_.short_name, organizati6_.id
  • Buffers: shared hit=1 read=2
  • I/O Timings: read=255.540
35. 255.593 255.593 ↑ 1.0 1 1

Index Scan using pim_organization_pk on public.pim_organization organizati6_ (cost=0.29..8.31 rows=1 width=53) (actual time=255.591..255.593 rows=1 loops=1)

  • Output: organizati6_.short_name, organizati6_.id
  • Index Cond: (organizati6_.id = 5,028)
  • Buffers: shared hit=1 read=2
  • I/O Timings: read=255.540
36. 2.281 2.305 ↑ 1.0 8 461

Materialize (cost=0.00..1.12 rows=8 width=8) (actual time=0.001..0.005 rows=8 loops=461)

  • Output: careregime7_.code, careregime7_.id
  • Buffers: shared hit=1
37. 0.024 0.024 ↑ 1.0 8 1

Seq Scan on public.mc_care_regimen careregime7_ (cost=0.00..1.08 rows=8 width=8) (actual time=0.017..0.024 rows=8 loops=1)

  • Output: careregime7_.code, careregime7_.id
  • Buffers: shared hit=1
38. 0.195 239.832 ↑ 1.0 167 1

Hash (cost=8.67..8.67 rows=167 width=67) (actual time=239.832..239.832 rows=167 loops=1)

  • Output: medicalpro8_.name, medicalpro8_.id
  • Buckets: 1,024 Batches: 1 Memory Usage: 25kB
  • Buffers: shared hit=2 read=5
  • I/O Timings: read=239.379
39. 239.637 239.637 ↑ 1.0 167 1

Seq Scan on public.md_profile medicalpro8_ (cost=0.00..8.67 rows=167 width=67) (actual time=79.914..239.637 rows=167 loops=1)

  • Output: medicalpro8_.name, medicalpro8_.id
  • Buffers: shared hit=2 read=5
  • I/O Timings: read=239.379
40. 0.140 211.931 ↑ 1.0 63 1

Hash (cost=4.63..4.63 rows=63 width=120) (actual time=211.931..211.931 rows=63 loops=1)

  • Output: caseinitgo9_.name, caseinitgo9_.id
  • Buckets: 1,024 Batches: 1 Memory Usage: 18kB
  • Buffers: shared hit=1 read=3
  • I/O Timings: read=211.679
41. 211.791 211.791 ↑ 1.0 63 1

Seq Scan on public.mc_case_init_goal caseinitgo9_ (cost=0.00..4.63 rows=63 width=120) (actual time=0.014..211.791 rows=63 loops=1)

  • Output: caseinitgo9_.name, caseinitgo9_.id
  • Buffers: shared hit=1 read=3
  • I/O Timings: read=211.679
42. 8,112.678 8,112.678 ↑ 1.0 1 461

Index Scan using mc_diagnosis_pk on public.mc_diagnosis casediagno10_ (cost=0.56..8.56 rows=1 width=19) (actual time=17.596..17.598 rows=1 loops=461)

  • Output: casediagno10_.note, casediagno10_.id, casediagno10_.disease_type_id, casediagno10_.diagnos_id
  • Index Cond: (visit0_1_.main_diagnosis_id = casediagno10_.id)
  • Buffers: shared hit=1,724 read=584
  • I/O Timings: read=8,099.202
43. 2.285 2.305 ↑ 1.0 6 461

Materialize (cost=0.00..1.09 rows=6 width=55) (actual time=0.001..0.005 rows=6 loops=461)

  • Output: diseasetyp11_.name, diseasetyp11_.id
  • Buffers: shared hit=1
44. 0.020 0.020 ↑ 1.0 6 1

Seq Scan on public.mc_disease_type diseasetyp11_ (cost=0.00..1.06 rows=6 width=55) (actual time=0.016..0.020 rows=6 loops=1)

  • Output: diseasetyp11_.name, diseasetyp11_.id
  • Buffers: shared hit=1
45. 15.545 1,658.698 ↑ 1.0 16,384 1

Hash (cost=1,647.84..1,647.84 rows=16,384 width=126) (actual time=1,658.698..1,658.698 rows=16,384 loops=1)

  • Output: diagnosis12_.name, diagnosis12_.code, diagnosis12_.id
  • Buckets: 16,384 Batches: 1 Memory Usage: 2,699kB
  • Buffers: shared hit=1,043 read=441
  • I/O Timings: read=1,620.559
46. 1,643.153 1,643.153 ↑ 1.0 16,384 1

Seq Scan on public.md_diagnosis diagnosis12_ (cost=0.00..1,647.84 rows=16,384 width=126) (actual time=1,346.572..1,643.153 rows=16,384 loops=1)

  • Output: diagnosis12_.name, diagnosis12_.code, diagnosis12_.id
  • Buffers: shared hit=1,043 read=441
  • I/O Timings: read=1,620.559
47. 6,119.775 6,119.775 ↑ 1.0 1 461

Index Scan using mc_case_pk on public.mc_case medicalcas13_ (cost=0.44..8.40 rows=1 width=27) (actual time=13.274..13.275 rows=1 loops=461)

  • Output: medicalcas13_.uid, medicalcas13_.open_date, medicalcas13_.closing_step_id, medicalcas13_.id, medicalcas13_.state_id, medicalcas13_.care_providing_form_id
  • Index Cond: (visit0_1_.case_id = medicalcas13_.id)
  • Buffers: shared hit=1,396 read=451
  • I/O Timings: read=6,104.298
48. 2.279 2.305 ↑ 1.0 8 461

Materialize (cost=0.00..1.12 rows=8 width=42) (actual time=0.001..0.005 rows=8 loops=461)

  • Output: casestate14_.name, casestate14_.id
  • Buffers: shared hit=1
49. 0.026 0.026 ↑ 1.0 8 1

Seq Scan on public.mc_case_state casestate14_ (cost=0.00..1.08 rows=8 width=42) (actual time=0.013..0.026 rows=8 loops=1)

  • Output: casestate14_.name, casestate14_.id
  • Buffers: shared hit=1
50. 3,055.969 3,055.969 ↑ 1.0 1 461

Index Scan using pci_patient_pk on public.pci_patient patient15_ (cost=0.43..7.74 rows=1 width=4) (actual time=6.627..6.629 rows=1 loops=461)

  • Output: patient15_.id
  • Index Cond: ((patient15_.id = visit0_1_._patient_id) AND (patient15_.id IS NOT NULL))
  • Filter: (patient15_.is_arch IS NOT TRUE)
  • Buffers: shared hit=1,652 read=192
  • I/O Timings: read=3,044.317
51. 3,744.703 3,744.703 ↑ 1.0 1 461

Index Scan using pim_individual_pk on public.pim_individual individual16_ (cost=0.43..6.62 rows=1 width=54) (actual time=8.122..8.123 rows=1 loops=461)

  • Output: individual16_.id, individual16_.name, individual16_.surname, individual16_.patr_name
  • Index Cond: (patient15_.id = individual16_.id)
  • Buffers: shared hit=1,654 read=190
  • I/O Timings: read=3,736.374
52. 124.009 124.009 ↑ 1.0 1 461

Index Only Scan using mc_case_pk on public.mc_case medicalcas18_ (cost=0.44..4.41 rows=1 width=4) (actual time=0.200..0.269 rows=1 loops=461)

  • Output: medicalcas18_.id
  • Index Cond: (medicalcas18_.id = visit0_1_.case_id)
  • Heap Fetches: 0
  • Buffers: shared hit=1,424 read=12
  • I/O Timings: read=118.692
53.          

SubPlan (for Nested Loop)

54. 2.305 7,913.526 ↓ 0.0 0 461

Limit (cost=10,939.91..10,939.91 rows=1 width=8) (actual time=17.166..17.166 rows=0 loops=461)

  • Output: r.bdate, mr.id
  • Buffers: shared hit=5,426 read=595
  • I/O Timings: read=7,872.819
55. 4.610 7,911.221 ↓ 0.0 0 461

Sort (cost=10,939.91..10,939.91 rows=1 width=8) (actual time=17.161..17.161 rows=0 loops=461)

  • Output: r.bdate, mr.id
  • Sort Key: mr.id DESC
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=5,426 read=595
  • I/O Timings: read=7,872.819
56. 2.305 7,906.611 ↓ 0.0 0 461

Nested Loop Semi Join (cost=2.12..10,939.90 rows=1 width=8) (actual time=17.151..17.151 rows=0 loops=461)

  • Output: r.bdate, mr.id
  • Join Filter: (r.service_id = mes.service_id)
  • Buffers: shared hit=5,426 read=595
  • I/O Timings: read=7,872.819
57. 5.993 7,868.348 ↑ 431.0 1 461

Nested Loop (cost=1.14..3,759.80 rows=431 width=16) (actual time=17.065..17.068 rows=1 loops=461)

  • Output: mr.id, mr.case_id, r.bdate, r.service_id
  • Buffers: shared hit=4,020 read=592
  • I/O Timings: read=7,843.337
58. 7,856.362 7,856.362 ↑ 431.0 1 461

Index Scan using md_srv_rendered_step_id_idx on public.md_srv_rendered mr (cost=0.57..55.35 rows=431 width=8) (actual time=17.041..17.042 rows=1 loops=461)

  • Output: mr.id, mr.is_urgent, mr.is_use_cryogenic, mr.is_use_endoscopic, mr.is_use_laser, mr.anesthesia_type_id, mr.step_id, mr.complication_type_id, mr.diagnosis_id, mr.case_id, mr.referral_id, mr.result_category_id, mr.patient_prescription_id, mr.health_group_id, mr.vmp_type_id, mr.vmp_method_id, mr.anatomic_zone_id, mr.aud_who, mr.aud_when, mr.aud_source, mr.aud_who_create, mr.aud_when_create, mr.aud_source_create, mr.prescription_id, mr.entity_sync_num, mr.complicated_value, mr.by_standard, mr.vmp_profile_id
  • Index Cond: (mr.step_id = visit0_.id)
  • Buffers: shared hit=1,714 read=592
  • I/O Timings: read=7,843.337
59. 5.993 5.993 ↑ 1.0 1 461

Index Scan using sr_srv_rendered_pk on public.sr_srv_rendered r (cost=0.57..8.59 rows=1 width=12) (actual time=0.013..0.013 rows=1 loops=461)

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

Nested Loop (cost=0.99..16.61 rows=1 width=8) (actual time=0.078..0.078 rows=0 loops=461)

  • Output: mep.case_id, mes.service_id
  • Buffers: shared hit=1,406 read=3
  • I/O Timings: read=29.482
61. 1.383 35.036 ↓ 0.0 0 461

Nested Loop (cost=0.71..13.64 rows=1 width=8) (actual time=0.076..0.076 rows=0 loops=461)

  • Output: mep.case_id, mesp.service_id
  • Buffers: shared hit=1,406 read=3
  • I/O Timings: read=29.482
62. 33.653 33.653 ↓ 0.0 0 461

Index Scan using md_event_patient__case_id_ix on disp.md_event_patient mep (cost=0.42..8.43 rows=1 width=8) (actual time=0.073..0.073 rows=0 loops=461)

  • Output: mep.id, mep.case_id
  • Index Cond: (mep.case_id = mr.case_id)
  • Buffers: shared hit=1,406 read=3
  • I/O Timings: read=29.482
63. 0.000 0.000 ↓ 0.0 0

Index Scan using md_event_service_patient__event_patient_id_ix on disp.md_event_service_patient mesp (cost=0.29..5.09 rows=12 width=8) (never executed)

  • Output: mesp.id, mesp.service_id, mesp.indiv_id, mesp.event_id, mesp.event_patient_id, mesp.aud_who, mesp.aud_when, mesp.aud_source, mesp.aud_who_create, mesp.aud_when_create, mesp.aud_source_create, mesp.barcode, mesp.biomaterial_dt, mesp.specialist_snils, mesp.status, mesp.referral_id, mesp.step_id
  • Index Cond: (mesp.event_patient_id = mep.id)
64. 0.000 0.000 ↓ 0.0 0

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

  • Output: mes.service_id, mes.id
  • Index Cond: (mes.id = mesp.service_id)
Planning time : 19.863 ms
Execution time : 77,729.679 ms