Subject:Improve xQuery Performance Author:dulmini s Date:13 Feb 2013 02:41 AM
I use stylus studio (with DATA DIRECT)/xQuery to join two xmls files to one( original files are converted from CSV to xml first and then joined). Customer(header) data read first and then matching transaction data for each cusomer read. (using a loop).
Transaction data is also grouped by transaction date(year). This is done by using distinct function. Transaction data file is quite large and it is quite slow to process.( tables about 10 hrs for 20,000 customer records) I'm looking at ways to improve performance. any help or advice is much approciated. below is the sample of the code used.
Subject:Improve xQuery Performance Author:Minollo I. Date:13 Feb 2013 11:18 AM
One thing I would try is to create the transaction document only once, and for all customers; so, basically doing:
let $all-transactions :=
...before the external loop - so that it's done once and for all, and then you just focus on filtering $my-transactions out of it.
The other thing I would try is to change xml-streaming to "no"; with a distinct-values() in the picture, there is little value in attempting to stream; and, if anything, that could slow things down a bit.