home clear 64x64
en blue 200x116 de orange 200x116 info letter User
suche 36x36
Latest versionsfixlist
11.1.0.7 FixList
10.5.0.9 FixList
10.1.0.6 FixList
9.8.0.5 FixList
9.7.0.11 FixList
9.5.0.10 FixList
9.1.0.12 FixList
Have problems? - contact us.
Register for free anmeldung-x26
Contact form kontakt-x26

DB2 - Problem description

Problem IT07806 Status: Closed

QUERIES WITH CASE WHEN USING SUBQUERIES MAY LEAD TO PERFORMANCE ISSUE.

product:
DB2 FOR LUW / DB2FORLUW / A50 - DB2
Problem description:
Queries in the following form may show bad performance when a 
CASE WHEN condition contains subqueries: 
 
SELECT COUNT(*) 
FROM 
   (SELECT T1.COL1, T1.COL2, T1.COL3, T1.COL4, 
           T1.COL5, T1.COL6, T1.COL7, T1.COL8 
   FROM TAB01 T1 INNER JOIN TAB02 T2 INNER JOIN session.#tt4 T3 
           ON 1=1 ON (T1.COL2 = T2.COL2) 
   WHERE ((T2.COL6 = 'My string' AS CHAR(16)FOR BIT DATA))) AND 
   CASE 
   WHEN (T3.COL55 > CAST(2 AS NUMERIC(1, 0))) 
   THEN CAST(x'01' AS CHAR(1) FOR BIT DATA) 
   ELSE 
      CASE 
      WHEN (((T2.MyCol_A IN (SELECT T4.MyCol_B AS MyCol_B FROM 
session.#tt5 T4)) 
          OR (T2.MyCol_C IN (SELECT T5.MyCol_B AS MyCol_B FROM 
session.#tt5 T5))) 
          OR (T2.MyCol_D IN (SELECT T6.MyCol_B AS MyCol_B FROM 
session.#tt5 T6))) 
      THEN CAST(x'01' AS CHAR(1) FOR BIT DATA) 
      ELSE CAST(x'00' AS CHAR(1) FOR BIT DATA) 
      END 
   END = CAST(x'01' AS CHAR(1) FOR BIT DATA))
Problem Summary:
**************************************************************** 
* USERS AFFECTED:                                              * 
* all editions                                                 * 
**************************************************************** 
* PROBLEM DESCRIPTION:                                         * 
* See Error Description                                        * 
**************************************************************** 
* RECOMMENDATION:                                              * 
* Upgrade to version 10.5 Fix Pack 7                           * 
****************************************************************
Local Fix:
Solution
First fixed in version 10.5 Fix Pack 7
Workaround
not known / see Local fix
Timestamps
Date  - problem reported    :
Date  - problem closed      :
Date  - last modified       :
19.03.2015
20.01.2016
20.01.2016
Problem solved at the following versions (IBM BugInfos)
Problem solved according to the fixlist(s) of the following version(s)
10.5.0.7 FixList