The extra fragment accesses are due to the extra fragments. The evaluator 
doesn't know that the full XPath matches without checking the parent fragment, 
and it does this once per match.

You could try cts:search(//cc, "cc1", "filtered") instead. But the evaluator 
may still need to traverse the full fragment structure.

This is one of the dozen or so reasons why I regard sub-fragments as a last 
resort.

-- Mike

On 23 Apr 2013, at 06:02 , Paul M <[email protected]> wrote:

> Say three documents with structure below:
> <test>
> <a>
> <a1>a1d3</a1>
> <a2>a2d3</a2>
> <d>dd3</d>
> <c><cc>very big -cc2</cc></c>
> <c><cc>very big -cc2</cc></c>
> <c><cc>very big -cc3</cc></c>
> <e>e1d3</e>
> </a>
> </test>
> 
> fragmented:
> fragment root cc
> 
> /test fragment root
> /cc three more fragment roots
> /cc
> /cc
> 
> A search is performed, say 
> cts:search(/test/a/c/cc, "cc1", "filtered")
> Regardless of the search, if it is filtered, qm look as such:
>     <qm:fragments>
>       <qm:fragment>
>     <qm:root>cc</qm:root>
>     <qm:expanded-tree-cache-hits>1</qm:expanded-tree-cache-hits>
>       <qm:fragment>
>     <qm:root>test</qm:root> <!-- three other test documents -->
>     <qm:expanded-tree-cache-hits>3</qm:expanded-tree-cache-hits>
>     <qm:documents>
>       <qm:document>
>     <qm:uri>/test1.xml</qm:uri>
>     <qm:expanded-tree-cache-hits>4</qm:expanded-tree-cache-hits>
>     
> Unfiltered results in qm look as follows:
>    <qm:fragments>
>       <qm:fragment>
>     <qm:root>cc</qm:root>
>     <qm:expanded-tree-cache-hits>1</qm:expanded-tree-cache-hits>
>     <qm:documents>
>       <qm:document>
>     <qm:uri>/test1.xml</qm:uri>
>     <qm:expanded-tree-cache-hits>1</qm:expanded-tree-cache-hits>
> 
> Wondering  why difference in querymeters? Were multiple fragments loaded?
> If so, how to search and retrieve only  cc elements?
> 
> Note: querytrace is the "same" ( Selected 1 fragment to filter vs Selected 1 
> fragment).
>     
>     
> 
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to