DB2 - Problem description
Problem IT03070 | Status: Closed |
DB2 MIGHT NOT OPTIMIZE SQL QUERIES CONTAINING OUTER JOINS AND EXISTENTIAL SUBQUERIES | |
product: | |
DB2 FOR LUW / DB2FORLUW / A10 - DB2 | |
Problem description: | |
DB2 might not be able to fully optimize queries containing the following pattern leading to long execution times. Pattern conditions: 1) The query contains one or more outer joins. 2) The null producing side of the outer join is involved in a correlated predicate inside a subquery 3) The subquery is of the form EXISTS or IN. 4) The subquery is used in the context of a predicate with no complex expressions like OR, CASE, etc. eg. select * from t1 left join t2 on t1.c1 = t2.c1 where exists (select * from t3 where t2.c2 = t3.c2); select * from t1 left join t2 on t1.c1 = t2.c1 where t2.c2 in (select c2 from t3); Workaround: Rewrite the query to convert the subquery into a DISTINCT inner join select * from t1 left join t2 on t1.c1 = t2.c1 inner join (select distinct c2 from t3) on t2.c2 = t3.c2 | |
Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * ALL * **************************************************************** * PROBLEM DESCRIPTION: * * See Problem Description above. * **************************************************************** * RECOMMENDATION: * * Upgrade to DB2 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 : | 10.07.2014 14.07.2015 14.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 |