DB2 - Problem description
Problem IT07803 | Status: Closed |
QUERIES WITH CASE WHEN USING SUBQUERIES MAY LEAD TO PERFORMANCE ISSUE. | |
product: | |
DB2 FOR LUW / DB2FORLUW / A10 - 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 * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * Upgrade to version 10.1 Fix Pack 5 * **************************************************************** | |
Local Fix: | |
Solution | |
First fixed in version 10.1 Fix Pack 5 | |
Workaround | |
not known / see Local fix | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 19.03.2015 16.07.2015 16.07.2015 |
Problem solved at the following versions (IBM BugInfos) | |
Problem solved according to the fixlist(s) of the following version(s) | |
10.1.0.5 |