Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

declareUpdate causing delay

To clean up my database, I run a script that deletes some documents. This script needs the declareUpdate() statement to be able to delete documents. But this causes extreme calculation times.
For example: the following never finishes with declareUpdate() in the script.

cts.remainder(fn.subsequence(fn.collection("deleteThis"), 1, 1))

This runs in a second without the declareUpdate(). Is it maybe checking all the reader/writer permissions on all the documents in cts.remainder?

like image 497
Thijs Avatar asked Feb 16 '26 06:02

Thijs


1 Answers

No, fn.collection reaches all docs in that collection, and in update mode uri read locks are applied for all of them. You are better off using cts.uris with a collection query, and then batch delete the docs in spawns..

HTH!

like image 190
grtjn Avatar answered Feb 19 '26 04:02

grtjn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!