XQuery optimization and xquery {?explain?}

Currently I’m working an a project for Philips, using Tamino 4.1.4 and some of our XQueries are not performing very well (even with indexes defined on all queried nodes)

I’m trying to find out why, using the xquery-explain function ({?explain?}), but this results in a lot of (undocumented?) xquery processing output that doesn’t make much sense to me…

Does anyone have an XSL available that formats the output of the XQuery explain function in a more readable format?

Could anyone tell me which tags to look for in the XQuery explain output indicating additional indexes need to be defined, database properties should be changed or the xquery has to be formulated in a completely different way?

Thanks,
Michel de Blok

Michel,
try this:

(1) Store attached stylesheet e.g. in ino:etc/xsl:stylesheet/xquery

(2) Assume, this is the query you want to analyze:

http://yourMachine/tamino/yourDB/types-decimal?_xquery= {?explain?} for $a in input()/types where $a/decimal = 1.0 return $a

Then extend URL as bold:

http://yourMachine/tamino/yourDB/types-decimal?_xquery/http://yourMachine/tamino/yourDB/ino:etc/xsl:stylesheet/xquery
= {?explain?} for $a in input()/types where $a/decimal = 1.0 return $a

This will give you a hopefully more helpful view of the result. There is also some Information in the documentation on “Query execution plan” or the explain command.

good luck,

Timm
XQueryExplanation.xml (8.74 KB)

Some good news for the future: With the next release (4.2), due end of Q2/2004, the Tamino X-Plorer Tool will support ino:explain in a graphical way.

Timm,

thanks for the quick reply! That is indeed good news, because the method you suggested (entering a complete XQuery in the url) isn’t quite workable for us (our xqueries can be pretty long)

I will make a test page in our application and use your stylesheet to present the ino:explain result.

Will let you know how it works out!