Hi, The collections are part of the document, so updating the collections updates the document. The document is the unit of caching, indexing and rewrite, and it is optimized in various ways, including being rewritten to a single, continuous record on disk – therefore it will be rewritten to disk in full when you alter it, including altering the collections. (if it was not, the record would need to remain fragmented on disk)
You can control this granularity by specifying a data model where different data is stored in different records, such as by storing a small metadata document (sometimes called a “sidecar document”) that is associated with your main document, typically by a URI pattern. Similarly, a properties fragment may be used to store metadata. Finally, you can store some RDF or triple data outside the main document as an alternative if you use triples. Any such smaller documents will be faster to update, but you will not get the full optimization benefit on read, because the system will load, cache and manage it separately. So balance storing data together in one document for faster query, search and retrieval, vs. splitting data up into multiple documents for faster bulk updates if that is a core use case for you. You may also adjust your thread count for the batch process, or tune your system if the system is under-utilized. Particularly be sure your transaction size is not set to 1 (100 is often good). Best, Damon From: general-bounces-dev-marklogic <general-boun...@developer.marklogic.com> on behalf of "C. Yaswanth" <rocking...@gmail.com> Reply-To: MarkLogic Discussion <general@developer.marklogic.com> Date: Wednesday, April 11, 2018 at 10:35 AM To: MarkLogic Discussion <general@developer.marklogic.com> Subject: [MarkLogic Dev General] Change the collection TAG for set of documents Hi All, Actually , I want to move(i.e.change) the documents(I.e.around 2M) from one collection to another. For that we tried xdmp:set-collection method which successfully did our job, but taken a lot of time(I.e.12min) which is nearly equal to the time for their ingestion into marklogic(13min). My question : If I am changing only the tag of a document from one collection to another then why it is taking that much time whether it is again creating the documents or just changing the collection tags on them ?? BTW we are using xdmp:set-collection in a SJS. Thanks
_______________________________________________ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general