explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Iqio

Settings
# exclusive inclusive rows x rows loops node
1. 0.072 29,079.837 ↓ 36.0 36 1

Unique (cost=19,201,259.14..19,201,259.22 rows=1 width=829) (actual time=29,079.724..29,079.837 rows=36 loops=1)

  • Functions: 324
  • Options: Inlining true, Optimization true, Expressions true, Deforming true
  • Timing: Generation 35.708 ms, Inlining 57.419 ms, Optimization 1899.460 ms, Emission 1380.014 ms, Total 3372.601 ms
2. 0.132 29,079.765 ↓ 36.0 36 1

Sort (cost=19,201,259.14..19,201,259.15 rows=1 width=829) (actual time=29,079.720..29,079.765 rows=36 loops=1)

  • Sort Key: tblfall.fallid, (DECODE( tblpatient_1.geschlecht , $0 , '@ICON(whitebgman_18x18.gif)'::character varying , $1 , '@ICON(whitebgwomen_18x18.gif)'::character varying , $2 , '@ICON(whitebgwomen_18x18.gif)'::character varying , $3 , '@ICON(whitebgwomen_18x18.gif)'::character varying , tblpatient_1.geschlecht )), tblfall.fallnr, tblpatient_1.patientennr, tblpatient_1.name, tblpatient_1.vorname, (tmp_fgetageinwords(tblpatient_1.geburtsdatum, tblpatient_1.todesdatum, 'J'::character varying, tblpatient_1.ispatientdead)), ((SubPlan 5)), ((SubPlan 6)), (DECODE( tblpatient_1.hatalarmkennzeich , 'J'::character varying , '@ICON(warning.gif)'::character varying , NULL::character varying )), (DECODE( ivtblcolorindicator.status22 , (NULL::text)::numeric , '@ICON(CIB_red_not.gif)'::character varying , (0)::numeric , '@ICON(CIB_red_not.gif)'::character varying , (1)::numeric , '@ICON(CIB_red_half.gif)'::character varying , (2)::numeric , '@ICON(CIB_red_full.gif)'::character varying , (ivtblcolorindicator.status22)::character varying )), (DECODE( ivtblcolorindicator.status23 , (NULL::text)::numeric , '@ICON(CIB_green_not.gif)'::character varying , (0)::numeric , '@ICON(CIB_green_not.gif)'::character varying , (1)::numeric , '@ICON(CIB_green_half.gif)'::character varying , (2)::numeric , '@ICON(CIB_green_full.gif)'::character varying , (ivtblcolorindicator.status23)::character varying )), (DECODE( ivtblcolorindicator.status24 , (NULL::text)::numeric , '@ICON(CIB_yellow_not.gif)'::character varying , (0)::numeric , '@ICON(CIB_yellow_not.gif)'::character varying , (1)::numeric , '@ICON(CIB_yellow_half.gif)'::character varying , (2)::numeric , '@ICON(CIB_yellow_full.gif)'::character varying , (ivtblcolorindicator.status24)::character varying )), (DECODE( ((SubPlan 8))::character varying , 'J'::character varying , '@ICON(collapsedparentnode.gif)'::character varying , NULL::character varying )), (DECODE( ((SubPlan 7))::character varying , 'J'::character varying , '@ICON(red_diamonds.gif)'::character varying , NULL::character varying )), (DECODE( ivtblcolorindicator.status1 , (NULL::text)::numeric , '@ICON(CIB_blue_not.gif)'::character varying , (0)::numeric , '@ICON(CIB_blue_not.gif)'::character varying , (1)::numeric , '@ICON(CIB_blue_half.gif)'::character varying , (2)::numeric , '@ICON(CIB_blue_full.gif)'::character varying , (ivtblcolorindicator.status1)::character varying )), (DECODE( ivtblcolorindicator.status2 , (NULL::text)::numeric , '@ICON(CIB_magenta_not.gif)'::character varying , (0)::numeric , '@ICON(CIB_magenta_not.gif)'::character varying , (1)::numeric , '@ICON(CIB_magenta_half.gif)'::character varying , (2)::numeric , '@ICON(CIB_magenta_full.gif)'::character varying , (ivtblcolorindicator.status2)::character varying )), (DECODE( ivtblcolorindicator.status3 , (NULL::text)::numeric , '@ICON(CIB_green_not.gif)'::character varying , (0)::numeric , '@ICON(CIB_green_not.gif)'::character varying , (1)::numeric , '@ICON(CIB_green_half.gif)'::character varying , (2)::numeric , '@ICON(CIB_green_full.gif)'::character varying , (ivtblcolorindicator.status3)::character varying )), (DECODE( ivtblcolorindicator.status4 , (NULL::text)::numeric , '@ICON(CIB_yellow_not.gif)'::character varying , (0)::numeric , '@ICON(CIB_yellow_not.gif)'::character varying , (1)::numeric , '@ICON(CIB_yellow_half.gif)'::character varying , (2)::numeric , '@ICON(CIB_yellow_full.gif)'::character varying , (ivtblcolorindicator.status4)::character varying )), (DECODE( ivtblcolorindicator.status5 , (NULL::text)::numeric , '@ICON(CIB_black_not.gif)'::character varying , (0)::numeric , '@ICON(CIB_black_not.gif)'::character varying , (1)::numeric , '@ICON(CIB_black_half.gif)'::character varying , (2)::numeric , '@ICON(CIB_black_full.gif)'::character varying , (ivtblcolorindicator.status5)::character varying )), (DECODE( ivtblcolorindicator.status6 , (NULL::text)::numeric , '@ICON(CIB_red_not.gif)'::character varying , (0)::numeric , '@ICON(CIB_red_not.gif)'::character varying , (1)::numeric , '@ICON(CIB_red_half.gif)'::character varying , (2)::numeric , '@ICON(CIB_red_full.gif)'::character varying , (ivtblcolorindicator.status6)::character varying )), (DECODE( ivtblcolorindicator.status7 , (NULL::text)::numeric , '@ICON(CIB_magenta_not.gif)'::character varying , (0)::numeric , '@ICON(CIB_magenta_not.gif)'::character varying , (1)::numeric , '@ICON(CIB_magenta_half.gif)'::character varying , (2)::numeric , '@ICON(CIB_magenta_full.gif)'::character varying , (ivtblcolorindicator.status7)::character varying )), (DECODE( ivtblcolorindicator.status8 , (NULL::text)::numeric , '@ICON(CIB_yellow_not.gif)'::character varying , (0)::numeric , '@ICON(CIB_yellow_not.gif)'::character varying , (1)::numeric , '@ICON(CIB_yellow_half.gif)'::character varying , (2)::numeric , '@ICON(CIB_yellow_full.gif)'::character varying , (ivtblcolorindicator.status8)::character varying )), (DECODE( ivtblcolorindicator.status9 , (NULL::text)::numeric , '@ICON(CIB_blue_not.gif)'::character varying , (0)::numeric , '@ICON(CIB_blue_not.gif)'::character varying , (1)::numeric , '@ICON(CIB_blue_half.gif)'::character varying , (2)::numeric , '@ICON(CIB_blue_full.gif)'::character varying , (ivtblcolorindicator.status9)::character varying )), (DECODE( ivtblcolorindicator.status10 , (NULL::text)::numeric , '@ICON(CIB_magenta_not.gif)'::character varying , (0)::numeric , '@ICON(CIB_magenta_not.gif)'::character varying , (1)::numeric , '@ICON(CIB_magenta_half.gif)'::character varying , (2)::numeric , '@ICON(CIB_magenta_full.gif)'::character varying , (ivtblcolorindicator.status10)::character varying )), (DECODE( ivtblcolorindicator.status11 , (NULL::text)::numeric , '@ICON(CIB_cornflowerblue_not.gif)'::character varying , (0)::numeric , '@ICON(CIB_cornflowerblue_not.gif)'::character varying , (1)::numeric , '@ICON(CIB_cornflowerblue_half.gif)'::character varying , (2)::numeric , '@ICON(CIB_cornflowerblue_full.gif)'::character varying , (ivtblcolorindicator.status11)::character varying )), (DECODE( ivtblcolorindicator.status12 , (NULL::text)::numeric , '@ICON(CIB_red_not.gif)'::character varying , (0)::numeric , '@ICON(CIB_red_not.gif)'::character varying , (1)::numeric , '@ICON(CIB_red_half.gif)'::character varying , (2)::numeric , '@ICON(CIB_red_full.gif)'::character varying , (ivtblcolorindicator.status12)::character varying )), (DECODE( ivtblcolorindicator.status13 , (NULL::text)::numeric , '@ICON(CIB_coral_not.gif)'::character varying , (0)::numeric , '@ICON(CIB_coral_not.gif)'::character varying , (1)::numeric , '@ICON(CIB_coral_half.gif)'::character varying , (2)::numeric , '@ICON(CIB_coral_full.gif)'::character varying , (ivtblcolorindicator.status13)::character varying )), (DECODE( ivtblcolorindicator.status14 , (NULL::text)::numeric , '@ICON(CIB_green_not.gif)'::character varying , (0)::numeric , '@ICON(CIB_green_not.gif)'::character varying , (1)::numeric , '@ICON(CIB_green_half.gif)'::character varying , (2)::numeric , '@ICON(CIB_green_full.gif)'::character varying , (ivtblcolorindicator.status14)::character varying )), tblpatient_1.geburtsdatum, (DECODE( floor(((nvl((0)::numeric, (0)::numeric) + (1)::numeric) / (nvl(tblpatient.istvip, (0)::numeric) + (1)::numeric))) , (0)::numeric , 1 , 0 ))
  • Sort Method: quicksort Memory: 61kB
3. 57.697 29,079.633 ↓ 36.0 36 1

Hash Join (cost=19,181,117.67..19,201,259.13 rows=1 width=829) (actual time=28,754.180..29,079.633 rows=36 loops=1)

  • Hash Cond: (tblfall_1.fallid = tblfall.fallid)
4. 1,558.325 25,682.858 ↓ 1.0 555,630 1

Sort (cost=19,180,942.82..19,182,331.89 rows=555,625 width=812) (actual time=25,414.923..25,682.858 rows=555,630 loops=1)

  • Sort Key: ((SubPlan 6)), ((SubPlan 5)), tblpatient_1.name, tblpatient_1.vorname
  • Sort Method: external merge Disk: 294,696kB
5.          

Initplan (for Sort)

6. 0.049 0.049 ↑ 1.0 1 1

Index Scan using xpktsyitbmed on tsyitbmed (cost=0.28..8.31 rows=1 width=32) (actual time=0.046..0.049 rows=1 loops=1)

  • Index Cond: ((code)::text = 'NLS_GESCHLECHT_MANNLICH'::text)
7. 0.019 0.019 ↑ 1.0 1 1

Index Scan using xpktsyitbmed on tsyitbmed tsyitbmed_1 (cost=0.28..8.31 rows=1 width=32) (actual time=0.017..0.019 rows=1 loops=1)

  • Index Cond: ((code)::text = 'NLS_GESCHLECHT_WEIBLICH'::text)
8. 0.057 0.057 ↑ 1.0 1 1

Index Scan using xpktsyitbmed on tsyitbmed tsyitbmed_2 (cost=0.28..8.31 rows=1 width=32) (actual time=0.055..0.057 rows=1 loops=1)

  • Index Cond: ((code)::text = 'NLS_GESCHLECHT_UNBEKANNT'::text)
9. 0.065 0.065 ↑ 1.0 1 1

Index Scan using xpktsyitbmed on tsyitbmed tsyitbmed_3 (cost=0.28..8.31 rows=1 width=32) (actual time=0.063..0.065 rows=1 loops=1)

  • Index Cond: ((code)::text = 'NLS_GESCHLECHT_UNBESTIMMT'::text)
10. 20,280.065 24,124.343 ↓ 1.0 555,630 1

Hash Left Join (cost=23,714.28..18,928,483.52 rows=555,625 width=812) (actual time=251.280..24,124.343 rows=555,630 loops=1)

  • Hash Cond: ((tblfall_1.patientenid = ivtblcolorindicator.patientenid) AND (tblfall_1.fallid = ivtblcolorindicator.caseid))
11. 656.888 1,065.817 ↓ 1.0 555,630 1

Hash Join (cost=23,695.69..62,218.02 rows=555,625 width=63) (actual time=250.032..1,065.817 rows=555,630 loops=1)

  • Hash Cond: (tblfall_1.patientenid = tblpatient_1.patientenid)
12. 159.777 159.777 ↓ 1.0 555,630 1

Seq Scan on tblfall tblfall_1 (cost=0.00..37,063.75 rows=555,625 width=12) (actual time=0.028..159.777 rows=555,630 loops=1)

13. 86.044 249.152 ↑ 1.0 243,131 1

Hash (cost=15,793.93..15,793.93 rows=243,131 width=57) (actual time=249.151..249.152 rows=243,131 loops=1)

  • Buckets: 262,144 Batches: 1 Memory Usage: 25,091kB
14. 163.108 163.108 ↑ 1.0 243,131 1

Seq Scan on tblpatient tblpatient_1 (cost=0.00..15,793.93 rows=243,131 width=57) (actual time=0.047..163.108 rows=243,131 loops=1)

15. 0.018 0.311 ↑ 3.5 4 1

Hash (cost=18.11..18.11 rows=14 width=558) (actual time=0.305..0.311 rows=4 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
16. 0.008 0.293 ↑ 3.5 4 1

Subquery Scan on ivtblcolorindicator (cost=16.67..18.11 rows=14 width=558) (actual time=0.283..0.293 rows=4 loops=1)

17. 0.172 0.285 ↑ 3.5 4 1

HashAggregate (cost=16.67..17.69 rows=14 width=565) (actual time=0.279..0.285 rows=4 loops=1)

  • Group Key: tblcolorindicator.patientenid, tblcolorindicator.caseid, tblcolorindicator.ward
18. 0.113 0.113 ↑ 1.0 68 1

Seq Scan on tblcolorindicator (cost=0.00..10.38 rows=68 width=29) (actual time=0.030..0.113 rows=68 loops=1)

  • Filter: (stripid = ANY ('{1,2,3,4,5,6,7,8,9,10,11,12,13,14,22,23,24}'::numeric[]))
  • Rows Removed by Filter: 76
19.          

SubPlan (for Hash Left Join)

20. 555.630 1,111.260 ↑ 1.0 1 555,630

Aggregate (cost=8.32..8.35 rows=1 width=32) (actual time=0.002..0.002 rows=1 loops=555,630)

21. 555.630 555.630 ↓ 0.0 0 555,630

Index Scan using xie1qckaktfallid on qckaktaufenthort (cost=0.28..8.32 rows=1 width=10) (actual time=0.001..0.001 rows=0 loops=555,630)

  • Index Cond: (fallid = tblfall_1.fallid)
22. 0.000 555.630 ↑ 1.0 1 555,630

Aggregate (cost=8.32..8.35 rows=1 width=32) (actual time=0.001..0.001 rows=1 loops=555,630)

23. 555.630 555.630 ↓ 0.0 0 555,630

Index Scan using xie1qckaktfallid on qckaktaufenthort qckaktaufenthort_1 (cost=0.28..8.32 rows=1 width=5) (actual time=0.001..0.001 rows=0 loops=555,630)

  • Index Cond: (fallid = tblfall_1.fallid)
24. 0.000 555.630 ↑ 1.0 1 555,630

Aggregate (cost=8.32..8.35 rows=1 width=32) (actual time=0.001..0.001 rows=1 loops=555,630)

25. 555.630 555.630 ↓ 0.0 0 555,630

Index Scan using xie1qckaktfallid on qckaktaufenthort qckaktaufenthort_2 (cost=0.28..8.32 rows=1 width=2) (actual time=0.001..0.001 rows=0 loops=555,630)

  • Index Cond: (fallid = tblfall_1.fallid)
26. 0.000 555.630 ↑ 1.0 1 555,630

Aggregate (cost=8.32..8.35 rows=1 width=32) (actual time=0.001..0.001 rows=1 loops=555,630)

27. 555.630 555.630 ↓ 0.0 0 555,630

Index Scan using xie1qckaktfallid on qckaktaufenthort qckaktaufenthort_3 (cost=0.28..8.32 rows=1 width=2) (actual time=0.001..0.001 rows=0 loops=555,630)

  • Index Cond: (fallid = tblfall_1.fallid)
28. 0.037 3,339.078 ↓ 36.0 36 1

Hash (cost=174.81..174.81 rows=1 width=16) (actual time=3,339.070..3,339.078 rows=36 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
29. 0.087 3,339.041 ↓ 36.0 36 1

Nested Loop (cost=0.84..174.81 rows=1 width=16) (actual time=3,338.732..3,339.041 rows=36 loops=1)

30. 3,338.774 3,338.774 ↓ 36.0 36 1

Index Scan using xpkfall on tblfall (cost=0.42..166.35 rows=1 width=19) (actual time=3,338.617..3,338.774 rows=36 loops=1)

  • Index Cond: ((fallid > '0'::numeric) AND (fallid = ANY ('{575666,575690,575693,575694,575697,575698,575699,575700,575860,576048,576627,576631,576633,576634,576636,576642,576643,576644,576721,576722,576724,576725,576726,576727,576728,577017,577018,577019,577020,577095,577096,577097,577098,577099,577100,579400}'::numeric[])))
  • Filter: ((stornierer IS NULL) AND ((einrichtung)::text = 'CARE'::text))
31. 0.180 0.180 ↑ 1.0 1 36

Index Scan using xpkpatient2 on tblpatient (cost=0.42..8.46 rows=1 width=9) (actual time=0.005..0.005 rows=1 loops=36)

  • Index Cond: (patientenid = tblfall.patientenid)
Execution time : 29,174.202 ms