|
|
||||
|
Re: Join optimization
by
Michael Kay
I've established why the two ">" join queries are running slightly slower in Saxon-SA. It's because, paradoxically, Saxon-B sometimes has better type information available than Saxon-SA. Given this path expression
for $i in /site/open_auctions/open_auction/initial
Saxon-B knows that the result of atomizing $i will be untyped atomic, and therefore (5000*$i) will be an xs:double, and therefore that in the expression $p/profile/@income > (5000 * $i), the left-hand operand will have to be converted to double and the comparison will be between two doubles. Saxon-SA, in the absence of a schema, doesn't know what types the nodes will be, and has to allow for the possibility that this expression is testing values of type duration. So it has to do more of the work at run-time.
If there's a moral to this tale, it's that Saxon-SA works best when there's a schema! In fact, if there isn't a schema, you can get the same behavior as Saxon-B by setting configuration.setAllNodesUntyped(true), which should redress the performance difference.
|
Search
Recent Comments
Recent Articles
Month Archive
|
|||