What is the best way to delete over 100,000 files?

I am trying to delete a large number of files uploaded to the MarkLogic database. The number of files in the directory that I want to delete is more than 100,000. I usually use two methods to delete files in the query console. Each file in the directory is indexed.

for $x in xdmp:directory("/English/","infinity")
return xdmp:document-delete(fn:document-uri($x))

and

xdmp:directory-delete("/English/")

When I execute any of the above methods, I get a "Time limit exceeded" which interrupts the operation.

My question

  • Is there any other better way to delete a bunch of files?
  • If not, is there a way to ignore XDMP-EXTIME or SVC-EXTIME?
+4
source share
2 answers

If you can clean the forest (s), this is often faster than removing a large number of documents.

xdmp:directory-delete, , , , :

  • directory-creation=manual.
  • .
  • .

, , .

+1

.

. .

, taskbot : .

+1

Source: https://habr.com/ru/post/1569150/


All Articles