explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 3ww6

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 50,324.496 ↑ 11.0 1 1

Limit (cost=1,952.94..3,832.77 rows=11 width=0) (actual time=2,132.050..50,324.496 rows=1 loops=1)

  • Output: (1)
  • Buffers: shared hit=104839 read=1085104
  • I/O Timings: read=34657.953
2. 0.006 50,324.491 ↑ 16,935.0 1 1

Nested Loop (cost=1,952.94..2,896,033.55 rows=16,935 width=0) (actual time=2,132.048..50,324.491 rows=1 loops=1)

  • Output: 1
  • Buffers: shared hit=104839 read=1085104
  • I/O Timings: read=34657.953
3. 0.011 50,324.469 ↑ 17,518.0 1 1

Nested Loop Left Join (cost=1,952.37..2,820,009.66 rows=17,518 width=8) (actual time=2,132.027..50,324.469 rows=1 loops=1)

  • Output: ssr.res_group_id, srgr.group_id
  • Filter: ((msr.case_id IS NULL) OR (SubPlan 1))
  • Buffers: shared hit=104834 read=1085104
  • I/O Timings: read=34657.953
4. 0.014 50,324.397 ↑ 26,057.0 1 1

Nested Loop Anti Join (cost=1,951.81..2,358,078.36 rows=26,057 width=12) (actual time=2,131.956..50,324.397 rows=1 loops=1)

  • Output: ssr.res_group_id, ssr.id, srgr.group_id
  • Buffers: shared hit=104823 read=1085104
  • I/O Timings: read=34657.953
5. 59.640 50,324.366 ↑ 40,126.0 1 1

Hash Join (cost=1,951.37..2,183,649.16 rows=40,126 width=12) (actual time=2,131.927..50,324.366 rows=1 loops=1)

  • Output: ssr.res_group_id, ssr.id, srgr.group_id
  • Hash Cond: (ssr.res_group_id = srgr.group_id)
  • Buffers: shared hit=104820 read=1085104
  • I/O Timings: read=34657.953
6. 50,263.649 50,263.649 ↑ 1.3 322,039 1

Seq Scan on public.sr_srv_rendered ssr (cost=0.00..2,179,789.16 rows=432,908 width=16) (actual time=3.895..50,263.649 rows=322,039 loops=1)

  • Output: ssr.id, ssr.bdate, ssr.comment, ssr.cost, ssr.duration, ssr.edate, ssr.is_rendered, ssr.quantity, ssr.total_cost, ssr.contract_id, ssr.customer_id, ssr.funding_id, ssr.res_group_id, ssr.service_id, ssr.duration_measure_unit_id, ssr.begin_time, ssr.prototype_id, ssr.org_id, ssr.price_list_id, ssr.cul, ssr.parent_id, ssr.payment_status_id, ssr.root_service_id, ssr.is_wholly_rendered, ssr.planned_date, ssr.planned_time, ssr.tooth_number, ssr.is_refused, ssr.aud_who, ssr.aud_when, ssr.aud_source, ssr.aud_who_create, ssr.aud_when_create, ssr.aud_source_create, ssr.is_amalgam_filling, ssr.is_mobile_medical_teams, ssr.close_date, ssr.complex_srv_id, ssr.for_upload, ssr.uid, ssr.is_need_consulting
  • Filter: ((ssr.planned_date IS NOT NULL) AND (ssr.bdate >= '2018-09-20'::date) AND (ssr.bdate <= '2018-09-30'::date))
  • Rows Removed by Filter: 65679712
  • Buffers: shared hit=104659 read=1085104
  • I/O Timings: read=34657.953
7. 0.158 1.077 ↑ 33.4 640 1

Hash (cost=1,684.57..1,684.57 rows=21,344 width=4) (actual time=1.077..1.077 rows=640 loops=1)

  • Output: srgr.group_id
  • Buckets: 32768 Batches: 1 Memory Usage: 279kB
  • Buffers: shared hit=161
8. 0.459 0.919 ↑ 33.4 640 1

HashAggregate (cost=1,471.13..1,684.57 rows=21,344 width=4) (actual time=0.734..0.919 rows=640 loops=1)

  • Output: srgr.group_id
  • Group Key: srgr.group_id
  • Buffers: shared hit=161
9. 0.128 0.460 ↑ 33.2 643 1

Nested Loop (cost=0.86..1,417.77 rows=21,344 width=4) (actual time=0.064..0.460 rows=643 loops=1)

  • Output: srgr.group_id
  • Buffers: shared hit=161
10. 0.026 0.026 ↑ 1.0 1 1

Index Scan using employee_position_id_unique on public.pim_employee_position_resource pepr1 (cost=0.29..8.30 rows=1 width=4) (actual time=0.025..0.026 rows=1 loops=1)

  • Output: pepr1.id, pepr1.employee_position_id, pepr1.aud_who, pepr1.aud_when, pepr1.aud_source, pepr1.aud_who_create, pepr1.aud_when_create, pepr1.aud_source_create
  • Index Cond: (pepr1.employee_position_id = 87510)
  • Buffers: shared hit=3
11. 0.306 0.306 ↑ 33.2 643 1

Index Only Scan using sr_res_group_relationship_resource_id_group_id_ix on public.sr_res_group_relationship srgr (cost=0.57..1,196.02 rows=21,344 width=8) (actual time=0.029..0.306 rows=643 loops=1)

  • Output: srgr.resource_id, srgr.group_id
  • Index Cond: (srgr.resource_id = pepr1.id)
  • Heap Fetches: 50
  • Buffers: shared hit=158
12. 0.017 0.017 ↓ 0.0 0 1

Index Only Scan using md_appointment_srv_rendered_id_idx on public.md_appointment ma (cost=0.44..4.34 rows=1 width=4) (actual time=0.017..0.017 rows=0 loops=1)

  • Output: ma.srv_rendered_id
  • Index Cond: (ma.srv_rendered_id = ssr.id)
  • Heap Fetches: 0
  • Buffers: shared hit=3
13. 0.015 0.015 ↑ 1.0 1 1

Index Scan using md_srv_rendered_pk on public.md_srv_rendered msr (cost=0.56..8.08 rows=1 width=8) (actual time=0.015..0.015 rows=1 loops=1)

  • Output: msr.id, msr.is_urgent, msr.is_use_cryogenic, msr.is_use_endoscopic, msr.is_use_laser, msr.anesthesia_type_id, msr.step_id, msr.complication_type_id, msr.diagnosis_id, msr.case_id, msr.referral_id, msr.result_category_id, msr.patient_prescription_id, msr.health_group_id, msr.vmp_type_id, msr.vmp_method_id, msr.anatomic_zone_id, msr.aud_who, msr.aud_when, msr.aud_source, msr.aud_who_create, msr.aud_when_create, msr.aud_source_create, msr.prescription_id, msr.by_standard, msr.complicated_value, msr.vmp_profile_id
  • Index Cond: (ssr.id = msr.id)
  • Buffers: shared hit=5
14.          

SubPlan (forNested Loop Left Join)

15. 0.025 0.046 ↑ 1.0 1 1

Nested Loop (cost=0.56..9.64 rows=1 width=0) (actual time=0.046..0.046 rows=1 loops=1)

  • Join Filter: (mc.case_type_id = mct.id)
  • Rows Removed by Join Filter: 1
  • Buffers: shared hit=6
16. 0.016 0.016 ↑ 1.0 1 1

Index Scan using mc_case_pk on public.mc_case mc (cost=0.56..8.58 rows=1 width=4) (actual time=0.016..0.016 rows=1 loops=1)

  • Output: mc.case_type_id
  • Index Cond: (msr.case_id = mc.id)
  • Buffers: shared hit=5
17. 0.005 0.005 ↑ 1.0 2 1

Seq Scan on public.mc_case_type mct (cost=0.00..1.04 rows=2 width=4) (actual time=0.005..0.005 rows=2 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_source_create
  • Filter: (mct.case_mode_id = 1)
  • Rows Removed by Filter: 1
  • Buffers: shared hit=1
18. 0.016 0.016 ↑ 1.0 1 1

Index Only Scan using sr_res_group_pk on public.sr_res_group srg (cost=0.57..4.33 rows=1 width=4) (actual time=0.016..0.016 rows=1 loops=1)

  • Output: srg.id
  • Index Cond: (srg.id = ssr.res_group_id)
  • Heap Fetches: 0
  • Buffers: shared hit=5