How does MarkLogic "xdmp: collection-delete" work?

I have a scenario in which most of the documents I want to delete are in a collection called "expired". I don’t want to overload my servers by running a lengthy process that will iterate over documents and delete them one by one. I would rather do them in batch size using document-delete.

So my question is: how does xdmp: collection-delete work?

Does he scan documents and delete them?

or

Does it do something like DROP Table in SQL and its "instantaneous"?

I want to know what the background process is for xdmp: collection-delete. I wonder if anyone can draw on the flow of how this function processes the document for deletion, as I want to understand the process in more detail than just an overview of what it does.

+5
source share
2 answers

xdmp: collection-delete () will delete all documents in the collection in a single transaction. Although this is not instantaneous, it should be fast, as it just needs to set a timestamp for deletion for each document.

+8
source

You can try using corb to delete documents one at a time. You can increase threads though for parallel processing.

+1
source

All Articles