DB2-z/OS: Bad performance in FAGL_GET_ITEMS_BSIS
[bad getway] [do bad in] [in bad] [in my bad]
Symptom
Wrong join order is used by DB2 to join table BSIS and FAGLFLEXA
in function module FAGL_GET_ITEMS_BSIS:
OPEN CURSOR WITH HOLD I_CURSOR FOR
select (lT_FLDLIST_S)
from (ld_dbtab_syntax) CLIENT SPECIFIED
where (lt_where_tab).
Reason and Prerequisites
Due to the REOPT(ONCE) feature of DB2 V8 the access path depends on the first set of values used. If this set is not typical a wrong access path might be determined and stored in the DB2 dynamic statement cache. This occurs in systems with data skew.
Solution
The attached modification instruction will enforce a full prepare of the SQL with each call so that DB2 can determine the optimal access path.