explain.depesz.com

PostgreSQL's explain analyze made readable

Result: GRT9

Settings
# exclusive inclusive rows x rows loops node
1. 55.274 233.705 ↑ 1.0 1 1

Nested Loop Semi Join (cost=0.85..43.75 rows=1 width=69) (actual time=233.701..233.705 rows=1 loops=1)

  • Output: i.id, (SubPlan 1), i.name, i.surname, i.patr_name, (SubPlan 2), i.gender_id, i.birth_dt, i.death_dt, get_min_priority_oms_doc(i.id), get_min_priority_identy_doc(i.id), get_job_org_name(i.id), (SubPlan 3)
  • Buffers: shared hit=26 read=23
  • I/O Timings: read=232.273
2. 31.473 31.473 ↑ 1.0 1 1

Index Scan using pim_individual_pk on public.pim_individual i (cost=0.43..8.45 rows=1 width=69) (actual time=31.469..31.473 rows=1 loops=1)

  • 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.age_year, i.age_month, i.age_day, i.list_main_contact, i.is_only_birth_year
  • Index Cond: (i.id = 1404980)
  • Buffers: shared hit=1 read=3
  • I/O Timings: read=31.392
3. 36.118 36.118 ↑ 1.0 1 1

Index Only Scan using pci_patient_pk on public.pci_patient p (cost=0.43..8.45 rows=1 width=4) (actual time=36.118..36.118 rows=1 loops=1)

  • Output: p.id
  • Index Cond: (p.id = 1404980)
  • Heap Fetches: 1
  • Buffers: shared hit=1 read=3
  • I/O Timings: read=36.041
4.          

SubPlan (for Nested Loop Semi Join)

5. 34.786 34.786 ↑ 1.0 1 1

Index Scan using pim_party_pk on public.pim_party (cost=0.43..8.45 rows=1 width=8) (actual time=34.783..34.786 rows=1 loops=1)

  • Output: pim_party.version
  • Index Cond: (pim_party.id = i.id)
  • Buffers: shared hit=1 read=3
  • I/O Timings: read=34.709
6. 0.006 46.108 ↑ 1.0 1 1

Limit (cost=0.43..17.10 rows=1 width=15) (actual time=46.108..46.108 rows=1 loops=1)

  • Output: pim_indiv_code.code
  • Buffers: shared hit=2 read=5
  • I/O Timings: read=45.946
7. 0.017 46.102 ↑ 1.0 1 1

Nested Loop (cost=0.43..17.10 rows=1 width=15) (actual time=46.102..46.102 rows=1 loops=1)

  • Output: pim_indiv_code.code
  • Join Filter: (pim_indiv_code.type_id = pim_code_type.id)
  • Rows Removed by Join Filter: 2
  • Buffers: shared hit=2 read=5
  • I/O Timings: read=45.946
8. 0.016 0.016 ↑ 1.0 1 1

Seq Scan on public.pim_code_type (cost=0.00..1.38 rows=1 width=4) (actual time=0.016..0.016 rows=1 loops=1)

  • Output: pim_code_type.id, pim_code_type.code, pim_code_type.format, pim_code_type.from_dt, pim_code_type.is_unique, pim_code_type.message_pattern, pim_code_type.name, pim_code_type.note, pim_code_type.occurrence, pim_code_type.to_dt, pim_code_type.party_type_id, pim_code_type.e_code, pim_code_type.aud_who, pim_code_type.aud_when, pim_code_type.aud_source, pim_code_type.aud_who_create, pim_code_type.aud_when_create, pim_code_type.aud_source_create
  • Filter: ((pim_code_type.code)::text = 'UID'::text)
  • Rows Removed by Filter: 7
  • Buffers: shared hit=1
9. 46.069 46.069 ↑ 1.0 3 1

Index Scan using pim_indiv_code_indiv_id_idx on public.pim_indiv_code (cost=0.43..15.69 rows=3 width=19) (actual time=27.771..46.069 rows=3 loops=1)

  • Output: pim_indiv_code.id, pim_indiv_code.code, pim_indiv_code.issue_dt, pim_indiv_code.type_id, pim_indiv_code.indiv_id, pim_indiv_code.sha256, pim_indiv_code.aud_who, pim_indiv_code.aud_when, pim_indiv_code.aud_source, pim_indiv_code.aud_who_create, pim_indiv_code.aud_when_create, pim_indiv_code.aud_source_create
  • Index Cond: (pim_indiv_code.indiv_id = i.id)
  • Buffers: shared hit=1 read=5
  • I/O Timings: read=45.946
10. 0.007 29.946 ↑ 1.0 1 1

Limit (cost=0.44..0.56 rows=1 width=4) (actual time=29.946..29.946 rows=1 loops=1)

  • Output: mc_step.admission_date
  • Buffers: shared hit=2 read=2
  • I/O Timings: read=29.872
11. 29.939 29.939 ↑ 78.0 1 1

Index Only Scan using mc_step_patient_id_admission_date_desc_ix on public.mc_step (cost=0.44..9.80 rows=78 width=4) (actual time=29.939..29.939 rows=1 loops=1)

  • Output: mc_step.admission_date
  • Index Cond: (mc_step._patient_id = i.id)
  • Heap Fetches: 0
  • Buffers: shared hit=2 read=2
  • I/O Timings: read=29.872
Planning time : 1.247 ms
Execution time : 233.851 ms