It's not about pre-loading. It's that the full XPath is a searchable
expression and can be optimized better than the one that uses an intermediary
variable which therefore is not a searchable expression.
But anyway, if you want performance, use cts:element-attribute-values() and not
distinct-values().
-jh-
On Jul 8, 2011, at 1:41 PM, Lee, David wrote:
> I'm curious about the behavior I'm seeing. I have a directory with about
> 300 XML files total 3GB.
> Each xml file is a few k to a 100M like
>
> <logfile host="hostname" ...>
> <log ... />
> lots o logs
> </logfile>
>
>
> I have a fragment rule setup on <log>
>
> This query returns fairly quickly (expected)
>
> fn:distinct-values( xdmp:directory("/logs/","infinity")/logfile/@host )
>
>
> This query gives me an expanded tree cache full error
>
> declare variable $all_logs := xdmp:directory("/logs/","infinity");
> fn:distinct-values( $all_logs/logfile/@host )
>
>
> This is not what I'd expect. I was under the impression that the documents
> wouldn't be pre-loaded just by declaring a variable holding a sequence of
> documents ... that it would lazy-eval as needed.
> So I was expecting the 2 statements to perform similarly.
>
> Obviously I'm wrong. Is this as expected ?
>
>
>
>
>
> ----------------------------------------
> David A. Lee
> Senior Principal Software Engineer
> Epocrates, Inc.
> [email protected]
> 812-482-5224
>
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general