David, I'm also unsure, but if your fragments are <log> elements and the @host attribute is at the root fragment, I suspect the <log> fragments are not loaded at all for the first query due to optimization. The second query loads the entire logfile document, including all log fragments.
Returning or logging xdmp:query-meters() output will tell you how many fragments are loaded (add expanded-tree-cache hits and misses) - of course you may need to increase the group's expanded-tree-cache memory allocation or reduce the size of the DB to test that. Yours, Damon From: [email protected] [mailto:[email protected]] On Behalf Of Lee, David Sent: Friday, July 08, 2011 4:41 PM To: General Mark Logic Developer Discussion ([email protected]) Subject: [MarkLogic Dev General] Expanded tree cache - depending expression 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]<mailto:[email protected]> 812-482-5224
_______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
