Hi Paul, Optimizing XPath is always tricky. I think the optimizer didn’t recognize that `collection($mycollection)/myelem` and ` collection($mycollection)[./myelem]` are (in terms of index resolution) effectively the same. And if the optimizer didn’t, it is likely that MarkLogic would have to filter out much more false positives in filtering stage.
Cheers, Geert From: <[email protected]> on behalf of Paul M <[email protected]> Reply-To: MarkLogic Developer Discussion <[email protected]> Date: Wednesday, May 23, 2018 at 6:06 PM To: "[email protected]" <[email protected]> Subject: [MarkLogic Dev General] fragments filter large difference collection($mycollection)/myelem[.//myA[@myattr="myval"]//myB="val"] vs collection($mycollection)[./myelem//myA[@myattr="myval"]//myB="val"] The first iteration performs markedly better than the second. The second attempts to filter a million + fragments. xdmp:query-trace shows only two constraints on the second iteration, namely fn:collection, when gathering constraints. Any insight appreciated on why so different.
_______________________________________________ General mailing list [email protected] Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
