explain.depesz.com

PostgreSQL's explain analyze made readable

Result: LvZ

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.007 9.482 ↓ 16.0 16 1

Unique (cost=994.90..994.93 rows=1 width=89) (actual time=9.474..9.482 rows=16 loops=1)

2. 1.074 9.475 ↓ 16.0 16 1

Sort (cost=994.90..994.91 rows=1 width=89) (actual time=9.474..9.475 rows=16 loops=1)

  • Sort Key: plan_instruction.plan_instruction_orderby, clinical_elements.clinical_elements_gwid, c
  • Sort Method: quicksort Memory: 27kB
  • -> Nested Loop Left Join (cost=989.24..994.89 rows=1 width=89) (actual time=9.278..9.438 rows=
  • -> Nested Loop Left Join (cost=989.24..993.29 rows=1 width=88) (actual time=9.261..9.331
  • -> Unique (cost=734.26..734.28 rows=1 width=77) (actual time=2.429..2.439 rows=16
  • -> Sort (cost=734.26..734.26 rows=1 width=77) (actual time=2.428..2.435 rows
  • Sort Key: clinical_elements.clinical_elements_gwid, clinical_elements.cl
  • Sort Method: quicksort Memory: 27kB
  • -> Nested Loop (cost=172.82..734.25 rows=1 width=77) (actual time=1.72
  • Join Filter: ((clinical_element_template_mapping.clinical_element_
  • -> Hash Join (cost=172.53..731.69 rows=2 width=44) (actual time=
  • Hash Cond: ((clinical_element_template_mapping.clinical_elem
  • -> Bitmap Heap Scan on clinical_element_template_mapping (
  • Recheck Cond: (clinical_element_template_mapping_templateid = 3764)
  • Filter: (((clinical_element_template_mapping_gwid)::text ~~* '00004006%'::text) OR ((clinical_element_template_mapping_gwid)::text = '0000400000000000002'::text))
  • Rows Removed by Filter: 2626
  • Heap Blocks: exact=106
3. 0.189 0.189 ↑ 1.0 2,642 1

Bitmap Index Scan on clinical_element_template_mapping_templateid_index1 (cost=0.00..52.48 rows=2,692 width=0) (actual time=0.189..0.189 rows=2,642 loops=1)

  • Index Cond: (clinical_element_template_mapping_templateid = 3764)
4. 0.545 1.092 ↑ 1.0 2,891 1

Hash (cost=83.91..83.91 rows=2,891 width=25) (actual time=1.092..1.092 rows=2,891 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 193kB
5. 0.547 0.547 ↑ 1.0 2,891 1

Seq Scan on plan_instruction (cost=0.00..83.91 rows=2,891 width=25) (actual time=0.007..0.547 rows=2,891 loops=1)

6. 0.160 0.160 ↑ 1.0 1 16

Index Scan using clinical_elements_gwid_index on clinical_elements (cost=0.29..1.27 rows=1 width=53) (actual time=0.010..0.010 rows=1 loops=16)

  • Index Cond: ((clinical_elements_gwid)::text = (plan_instruction.plan_instruction_gwid)::text)
7. 0.016 6.864 ↓ 0.0 0 16

Bitmap Heap Scan on patient_clinical_elements (cost=254.98..259.00 rows=1 width=31) (actual time=0.429..0.429 rows=0 loops=16)

  • Recheck Cond: ((patient_clinical_elements_encounterid = 336) AND ((patient_clinical_elements_gwid)::text = (clinical_element_template_mapping.clinical_element_template_mapping_gwid)::text))
8. 0.000 6.848 ↓ 0.0 0 16

BitmapAnd (cost=254.98..254.98 rows=1 width=0) (actual time=0.428..0.428 rows=0 loops=16)

9. 6.848 6.848 ↓ 0.0 0 16

Bitmap Index Scan on patient_clinical_elements_encounterid_index (cost=0.00..6.48 rows=273 width=0) (actual time=0.428..0.428 rows=0 loops=16)

  • Index Cond: (patient_clinical_elements_encounterid = 336)
10. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on patient_clinical_elements_gwid_index (cost=0.00..248.18 rows=9,016 width=0) (never executed)

  • Index Cond: ((patient_clinical_elements_gwid)::text = (clinical_element_template_mapping.clinical_element_template_mapping_gwid)::text)
11. 0.096 0.096 ↑ 1.0 1 16

Seq Scan on cnm_settings (cost=0.00..1.59 rows=1 width=1) (actual time=0.004..0.006 rows=1 loops=16)

  • Filter: (cnm_settings_id = 9) Rows Removed by Filter: 46