I cannot add much to that summary, expect that for this particular XQuery
expression it might be illuminating to wrap that cts:search with an
xdmp:estimate.
xdmp:estimate(cts:search( ...etc... ))
That should not throw XDMP-EXPNTREECACHEFULL, and should return the number of
documents that the cts:search alone would return. You can check that against
your expectations for the query. If they don't match, then the problem is
likely to be an interaction between the cts:query portion and the database
configuration. For example, that ModifiedDate element might not have a range
index.
For paginated search, take a look at the search developers guide:
http://docs.marklogic.com/5.0doc/docapp.xqy#display.xqy?fname=http%3a//pubs/5.0doc/xml/search-dev-guide/title.xml
and the search API reference:
http://docs.marklogic.com/5.0doc/docapp.xqy#display.xqy?fname=http://pubs/5.0doc/apidoc/searchapi.xml&category=Search&function=search:search
- a slightly higher-level API than cts:search provides.
-- Mike
On 5 Jun 2012, at 03:51 , Abhishek53 S wrote:
>
> Hi Sunny,
>
> I got the following answer for the same issue
>
>
> The expanded tree cache is used to store XML fragments while they are being
> used during query processing. XML documents are compressed and stored on disk
> as fragments. As fragments are needed during query evaluation, they are
> retrieved from disk in their compressed format and cached in the compressed
> tree cache. When the query needs to actually retrieve elements, values, or
> otherwise traverse the contents of one of these fragments, the fragment is
> uncompressed and cached in the expanded tree cache.
> Consequently, the expanded tree cache needs to be large enough to maintain a
> copy of every expanded XML fragment that is simultaneously needed during
> query processing. (Note that this doesn't necessarily mean that every
> fragment used by a given query is needed simultaneously; this depends on what
> a query does and how it is composed.)
> The error message "XDMP-EXPNTREECACHEFULL: Expanded tree cache full" means
> that MarkLogic has run out of room in the expanded tree cache during query
> evaluation, and that it cannot continue evaluating that query.
>
> There are four approaches to solving this problem:
> 1. Change the problem query so that it does not need to use as much expanded
> XML.
> 2. Tune the problem query so that it does not need to simultaneously cache as
> much XML.
> 3. Increase the size of the expanded tree cache, using the setting under
> Groups > Default > Configure
> 4. Fragment your content, if appropriate and only as a last resort.
>
> Approach (1) generally means a change in requirements (for instance,
> returning only 100 results instead of 1000 results). The typical approach is
> to page through a set of results rather than return all of the results at
> once.
> Approach (2) requires knowledge of tuning XQuery for performance. In some
> cases it's possible to compose a query that is able to process more expanded
> fragments than the expanded tree cache can store at any one moment.
> Approach (3) will work so long as you have sufficient available memory to
> expand the cache without adversely impacting other server and system
> functionality. This strategy is often a band-aid to a problem that would
> better be solved through approach (1) or (2).
> Approach (4) reflects the fact that large XML documents can take up a lot of
> memory during query evaluation, and Mark Logic's fragmentation capabilities
> are designed to be a method of last resort in such cases. Fragmentation
> allows MarkLogic to load only the needed parts of large documents during
> query evaluation, thereby reducing memory requirements. However,
> fragmentation does have other ramifications for query evaluation, as
> described in the Developer's Guide. If your expanded tree cache problem
> occurs while working with large documents, fragmentation may be an
> appropriate solution. If your problem occurs while working with small
> documents, fragmentation will not help.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Hope this information helps.
>
> Alternatively you can reply with average document size and final search
> query.
>
> Abhishek Srivastav
> Systems Engineer
> Tata Consultancy Services
> Cell:- +91-9883389968
> Mailto: [email protected]
> Website: http://www.tcs.com
> ____________________________________________
> Experience certainty. IT Services
> Business Solutions
> Outsourcing
> ____________________________________________
>
>
> From: Sunny Wang01 <[email protected]>
> To: MarkLogic Developer Discussion <[email protected]>
> Date: 06/05/2012 03:27 PM
> Subject: [MarkLogic Dev General] how to resolve the cache full problem?
> Sent by: [email protected]
>
>
>
>
> Hi All,
> When I use the search:search to get the search result ,in the host computer
> ,we have 13G free space ,but there is an error like below, could you help me?
>
> <dt>XDMP-EXPNTREECACHEFULL: cts:search(fn:collection(),
> cts:and-query((cts:element-value-query(fn:QName("http://www.careered.com/Metadata",
> "IsActive"), "true", ("lang=en"), 1),
> cts:element-range-query(fn:QName("http://www.careered.com/Version",
> "ModifiedDate"), ">=", xs:dateTime("0001-01-01T00:00:00"), (), 1),
> cts:element-range-query(fn:QName("http://www.careered.com/Version",
> "ModifiedDate"), "<", xs:dateTime("2012-06-05T09:45:32.603096"), (), 1),
> ...), ()), "score-logtfidf", 1) -- Expanded tree cache full on host </dt>
>
>
>
> Thanks,
> Sunny Wang01
> **************** CAUTION - Disclaimer *****************
> This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely
> for the use of the addressee(s). If you are not the intended recipient,
> please
> notify the sender by e-mail and delete the original message. Further, you are
> not
> to copy, disclose, or distribute this e-mail or its contents to any other
> person and
> any such actions are unlawful. This e-mail may contain viruses. Infosys has
> taken
> every reasonable precaution to minimize this risk, but is not liable for any
> damage
> you may sustain as a result of any virus in this e-mail. You should carry out
> your
> own virus checks before opening the e-mail or attachment. Infosys reserves
> the
> right to monitor and review the content of all messages sent to or from this
> e-mail
> address. Messages sent to or from this e-mail address may be stored on the
> Infosys e-mail system.
> ***INFOSYS******** End of Disclaimer ********INFOSYS***
>
> _______________________________________________
> General mailing list
> [email protected]
> http://community.marklogic.com/mailman/listinfo/general
>
>
>
> =====-----=====-----=====
> Notice: The information contained in this e-mail
> message and/or attachments to it may contain
> confidential or privileged information. If you are
> not the intended recipient, any dissemination, use,
> review, distribution, printing or copying of the
> information contained in this e-mail message
> and/or attachments to it are strictly prohibited. If
> you have received this communication in error,
> please notify us by reply e-mail or telephone and
> immediately and permanently delete the message
> and any attachments. Thank you
>
>
> _______________________________________________
> General mailing list
> [email protected]
> http://community.marklogic.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://community.marklogic.com/mailman/listinfo/general