home clear 64x64
en blue 200x116 de orange 200x116 info letter User
suche 36x36
Neueste VersionenFixList
11.1.0.7 FixList
10.5.0.9 FixList
10.1.0.6 FixList
9.8.0.5 FixList
9.7.0.11 FixList
9.5.0.10 FixList
9.1.0.12 FixList
Haben Sie Probleme? - Kontaktieren Sie uns.
Kostenlos registrieren anmeldung-x26
Kontaktformular kontakt-x26

DB2 - Problembeschreibung

Problem IC88349 Status: Geschlossen

XQuery with "let" expressions aggregating large sequences with
predicate may perform slower in v95/v97 vs. v91.

Produkt:
DB2 FOR LUW / DB2FORLUW / A10 - DB2
Problembeschreibung:
XQueries using "let" expressions which aggregate large xml 
sequences and apply some predicate on that sequence give slower 
performance in v95, v97 when compared with v91. 
 
The query: 
 
declare default element namespace "http://xxxx/ 
namespace/portal/ap0021/zc_xdb_ap0021.xsd"; let 
$Source:=db2-fn:xmlcolumn("ZC_AP0021.DATA")[1] return 
<root>{$Source}</root> 
 
The performance impact comes from the following "let" 
expression: 
 
let $Source:=db2-fn:xmlcolumn("ZC_AP0021.DATA") 
 
The problem here is that we collect  ALL xml documents found in 
DATA column into one huge sequence. Afterwards we apply 
positional predicate of [1] to every item in the large sequence 
to only fetch the first item. The performance hit is NOT coming 
from the positional predicate itself but from the fact that we 
are applying it to every item in that sequence. Applying any 
other kind of predicate to these kinds of sequences will give 
similar performance results. 
 
The performance for such queries is bad in all releases and we 
advice against writing similar queries but the performance for 
these kinds of queries appears to be worst starting v95 GA 
onwards. This is because performance improvements such as 
Multiple Extractions (MEP) and Predicate Pushdown where 
delivered which changed a large portion of the XML engine, from 
query compiler, optimizer to XML Navigation runtime. As side 
effect of these features was how XML Navigation changed the way 
it generates empty tuples to represent empty sequences which 
will have an impact for queries like the one above.
Problem-Zusammenfassung:
**************************************************************** 
* USERS AFFECTED:                                              * 
* DB2 UDB Version 10.1                                         * 
**************************************************************** 
* PROBLEM DESCRIPTION:                                         * 
* See Error Description                                        * 
**************************************************************** 
* RECOMMENDATION:                                              * 
* Upgrade to Version 10.1 FixPack 2.                           * 
****************************************************************
Local-Fix:
Rewrite query more efficiently so that it only fetches first row 
using sqlxml (xmltable). 
 
select 
xmlquery('declare default element namespace 
"http://xxxx/namespace/portal/ap0021/zc_xdb_ap0021.xsd"; let 
$ReceivedOrder := $newdoc return <root>{$ReceivedOrder}</root>' 
passing DOC as "newdoc") 
from 
(select T.DOC from 
 ZC_AP0021, 
 XMLTABLE (XMLNAMESPACES(DEFAULT 
'http://xxxx/namespace/portal/ap0021/zc_xdb_ap0021.xsd'), 
'$d' passing DATA as "d" 
    COLUMNS 
      DOC XML PATH '.') AS T 
FETCH FIRST ROW ONLY 
)@
verfügbare FixPacks:
DB2 Version 10.1 Fix Pack 2 for Linux, UNIX, and Windows
DB2 Version 10.1 Fix Pack 3 for Linux, UNIX, and Windows
DB2 Version 10.1 Fix Pack 4 for Linux, UNIX, and Windows
DB2 Version 10.1 Fix Pack 3a for Linux, UNIX, and Windows
DB2 Version 10.1 Fix Pack 6 for Linux, UNIX, and Windows

Lösung
Problem was first fixed in DB2 UDB Version 10.1 FixPack 2.
Workaround
keiner bekannt / siehe Local-Fix
Weitere Daten
Datum - Problem gemeldet    :
Datum - Problem geschlossen :
Datum - der letzten Änderung:
17.11.2012
06.05.2014
06.05.2014
Problem behoben ab folgender Versionen (IBM BugInfos)
Problem behoben lt. FixList in der Version
10.1.0.2 FixList
10.5.0.2 FixList