DB2 - Problem description
| Problem IT06549 | Status: Closed |
DB2 MIGHT FAIL WITH SQL0901N WHEN EXECUTING QUERY WITH MIX OF ANSI AND COMMA SEPARATED JOINS AND INTERDEPENDENCIES | |
| product: | |
DB2 FOR LUW / DB2FORLUW / A10 - DB2 | |
| Problem description: | |
Description:
Under rare scenarios, DB2 might fail with SQL0901N when the
following conditions are true:
1) The query contains 2 or more left or right outer joins
2) There is atleast one comma separated inner join in the middle
of the outer joins
3) The latter outer join has a dependency on the result of the
prior outer join due to presence of correlation
4) The tuple preserving side of atleast one of the outer join
has more than 90% distinct values on the output column
example:
select *
from t1 left join t2 on t1.c1 = t2.c1,
t3 left join lateral (select *
from t4
where t2.c1 = t4.c1) t4
on t4.c1 = t3.c1
where t1.c2 = t3.c2
Workaround:
Rewrite the comma separated join into ANSI format
select *
from t1 left join t2 on t1.c1 = t2.c1
inner join t3 on 1=1
left join lateral (select *
from t4
where t2.c1 = t4.c1) t4
on t4.c1 = t3.c1
where t1.c2 = t3.c2 | |
| Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * ALL * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * 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 : | 16.01.2015 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 |
|