XQuery transformations are often used in pipelines in Oracle Service Bus to perform data transformation. Performance of XQuery transformations is a key area to focus on when performance tuning an Oracle Service Bus environment.
During performance testing of your project you should use the activity timing metrics to identify any XQuery performance issues and optimize those queries for better performance. The recommended approach is to measure the average time taken to run each query, then multiply this by the number of times you expect that query to be used over some defined time period, e.g. one hour. The results should be sorted from largest to smallest. You should start at the top of the list and optimize as many of the queries as necessary to obtain the necessary performance. You should only optimize the queries if there is likely to be a significant performance gain. Optimization of the queries should be done by looking for opportunities to reorder or modify the statements in order to obtain faster execution.
XQuery performance should be tested with large payloads whenever possible, or at least with many invocations of the same transformation and results averaged.
Some general quidelines for improving the performance of XQuery transformations are as follows: