I've been testing some queries with the XQuery Whiteboard tool. When comparing distinct-values syntax for grouping, the 1.1 'group by' syntax is many times faster.
Since DB2 does not currently support XQuery 1.1, by goal is to embed the whiteboard query processing engine in my Java application. Unfortunately the query related methods in the XQueryWhiteboard.jar are not public accessible.
Are there any whiteboard jars available that I can include in my project?
Without the performance increase of the 'group by' syntax, DB2 would not be a viable candidate as a data source.
Thanks for any suggestions,
MatthiasNicola 120000E28R322 Posts
Re: XQuery 1.1 support2011-04-11T19:09:41ZThis is the accepted answer. This is the accepted answer.Hi Gary,
there is one more option that you have for efficient grouping and aggregation of XML. You can write the query in SQL/XML notation (i.e. SQL with embedded XQuery) and use the GROUP BY clause of the SQL language. If you need to process large amounts of data then this will probably provide better performance than grouping and aggregation inside your application.
An example of this approach is described in "Query 10" and "Query 11" of this article:
The example in "Query 11" returns a relational result set, but that can be changed so that it returns the result in whatever XML format you require.
Does that help?
Separately, let me find out about the availability of the query related methods in the XQuery Whiteboard.
SystemAdmin 110000D4XK230 Posts
Re: XQuery 1.1 support2011-04-11T21:16:46ZThis is the accepted answer. This is the accepted answer.Sorry, but we do not offer the query transformation code in XQuery Whiteboard for use in applications. XQuery Whiteboard allows us to demonstrate features are being considered by the XML Query WG. It is not product-quality code and for some of the features it does not perform particularly well.
In case you aren't aware of it, you can see the transformation that is being done by using View -> Generated XQuery after executing your query.
I'll also point out that group by is part of XQuery 3.0 (previously called XQuery 1.1), which has been published as a Working Draft, subject to change at any time.