Fixes are available
APAR status
Closed as program error.
Error description
If the below conditions are met, Db2 is not able to match eligible XML indexes which may lead to poor query performance. Indexes will not be able to be forced via guideline. 1. coexistance of index on XML column with expression based index on another non-XML column for the same table. 2. use of XMLTABLE function on a table with as described in 1 of the defined indexes 3. the XMLTABLE call and XML index definition refers the to the same XPath or subpath: e.g. using xmlpattern '/a/b/c' XMLTABLE('$XMLCOL/a' COLUMNS J varchar(255) path 'b/c') simplified repro: drop table TXML; create table TXML ( id integer not null generated always as identity, x varchar(255), xmlcol xml ) organize by row; alter table TXML add primary key (id); create index ix1 on TXML(xmlcol) generate key using xmlpattern '/a/b/c' as sql varchar (60 octets) ignore invalid values; create index ix2 on TXML (lower(x)); explain plan for SELECT xt.J, ID FROM TXML, XMLTABLE('$XMLCOL/a' COLUMNS J varchar(255) path 'b/c') as xt WHERE ((xt.J = 'XYZ')) ;
Local fix
query can possibly be rewritten to avoid listed conditions
Problem summary
**************************************************************** * USERS AFFECTED: * * All users with XML indexes that meet APAR criteria * **************************************************************** * PROBLEM DESCRIPTION: * * AFTER UPGRADE FROM V105, DB2 MAY BE UNABLE TO MATCH ELIGIBLE * * XML INDEXES FOR XQUERY, LEADING TO POOR QUERY PERFORMANCE. * * * * If the below conditions are met, Db2 is not able to match * * eligible XML indexes which may lead to poor query * * performance. * * Indexes will not be able to be forced via guideline. * * * * 1. coexistance of index on XML column with expression based * * index on another non-XML column for the same table. * * 2. use of XMLTABLE function on a table with as described in * * 1 of * * the defined indexes * * 3. the XMLTABLE call and XML index definition refers the to * * the * * same XPath or subpath: * * e.g. * * using xmlpattern '/a/b/c' * * XMLTABLE('$XMLCOL/a' COLUMNS J varchar(255) path 'b/c') * **************************************************************** * RECOMMENDATION: * * Apply fix pack containing code fix * ****************************************************************
Problem conclusion
This fix will correct the issue where Query Rewrite does not perform index matching in the outlined conditions.
Temporary fix
Comments
APAR Information
APAR number
IT31995
Reported component name
DB2 FOR LUW
Reported component ID
DB2FORLUW
Reported release
B10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt / Xsystem
Submitted date
2020-02-25
Closed date
2021-03-16
Last modified date
2021-03-16
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fix information
Fixed component name
DB2 FOR LUW
Fixed component ID
DB2FORLUW
Applicable component levels
RB10 PSN
UP
RB10 PSY
UP
RB50 PSN
UP
RB50 PSY
UP
[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSEPGG","label":"DB2 for Linux- UNIX and Windows"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"11.1","Line of Business":{"code":"LOB10","label":"Data and AI"}}]
Document Information
Modified date:
04 May 2022