explain.depesz.com

PostgreSQL's explain analyze made readable

Result: E8ik

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 404.102 ↑ 1.0 1 1

Result (cost=21,691.16..21,691.17 rows=1 width=0) (actual time=404.101..404.102 rows=1 loops=1)

  • Output: $1
  • Buffers: shared hit=21779
2.          

Initplan (for Result)

3. 0.008 404.099 ↑ 4.0 1 1

Nested Loop (cost=4,934.54..71,961.01 rows=4 width=0) (actual time=404.099..404.099 rows=1 loops=1)

  • Buffers: shared hit=21779
4. 248.628 404.055 ↑ 224.5 2 1

Hash Join (cost=4,934.12..70,249.45 rows=449 width=4) (actual time=404.053..404.055 rows=2 loops=1)

  • Output: sr.srv_type_id
  • Hash Cond: (sr.group_id = rg.id)
  • Buffers: shared hit=21771
5. 145.892 145.892 ↑ 1.8 1,283,788 1

Seq Scan on public.sr_res_group_service sr (cost=0.00..56,533.43 rows=2,340,643 width=8) (actual time=0.005..145.892 rows=1,283,788 loops=1)

  • Output: sr.id, sr.bdatetime, sr.edatetime, sr.power, sr.group_id, sr.srv_type_id, sr.moderation_required, sr.patient_multiple_appointment_per_day, sr.referral_required, sr.default_service, sr.aud_who, sr.aud_when, sr.aud_source, sr.aud_who_create, sr.aud_when_create, sr.aud_source_create
  • Buffers: shared hit=17925
6. 1.643 9.535 ↑ 2.6 5,149 1

Hash (cost=4,769.56..4,769.56 rows=13,165 width=4) (actual time=9.535..9.535 rows=5,149 loops=1)

  • Output: rg.id
  • Buckets: 16384 Batches: 1 Memory Usage: 310kB
  • Buffers: shared hit=3846
7. 7.892 7.892 ↑ 2.6 5,149 1

Index Only Scan using sr_res_group_responsible_id_id_ix on public.sr_res_group rg (cost=0.57..4,769.56 rows=13,165 width=4) (actual time=0.033..7.892 rows=5,149 loops=1)

  • Output: rg.id
  • Index Cond: (rg.responsible_id = 78020)
  • Heap Fetches: 3766
  • Buffers: shared hit=3846
8. 0.036 0.036 ↓ 0.0 0 2

Index Scan using sr_service_pk on public.sr_service s (cost=0.42..3.80 rows=1 width=4) (actual time=0.018..0.018 rows=0 loops=2)

  • Output: s.id, s.code, s.cul, s.is_death, s.duration, s.is_fictitious, s.is_independent, s.is_multuplicity, s.name, s.terms, s.org_id, s.category_id, s.duration_unit_id, s.prototype_id, s.type_id, s.from_dt, s.to_dt, s.is_repeated, s.is_inherit_protocol, s.is_expendable_materials, s.is_actual_cul, s.is_paraclinical, s.is_complex, s.accounting_id, s.is_fact, s.is_autocopy_diagnoses, s.is_stomat, s.srg_dif_type_id, s.srg_opr_kind_id, s.is_need_anatomic_zone, s.aud_who, s.aud_when, s.aud_source, s.aud_who_create, s.aud_when_create, s.aud_source_create, s.is_filling, s.is_extraction, s.is_need_close_date, s.is_vmp, s.short_name
  • Index Cond: (s.id = sr.srv_type_id)
  • Filter: ((btrim((s.code)::text) = 'B01.047.002'::text) OR (btrim((s.name)::text) = 'Прием врача терапевта повторный'::text))
  • Rows Removed by Filter: 0
  • Buffers: shared hit=8
Planning time : 1.191 ms
Execution time : 404.204 ms