You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature Request] Optarg for .delete() and .update() with array of ids #3177
So we could do a complex query, for example using .eqJoin() and instead of deleting/updating one by one with .forEach(), update/delete everything at once.
Close to that, but to update/delete a big batch at once would be much more effective
Even if you do a big batched delete, we break it up into smaller batches internally so that we don't block out other operations while it happens. I think a parallelized update inside for_each would be close as fast as a batched update. If we added a way for writes to be squashed together into batched writes while waiting for the btree, I think it would be just as fast.
From the ReQL side this this already possible I think, by using variadic getAll.
If the body of the for_each is simple, that works too, and should parallelize just fine. The problem with that approach is that you need to evaluate all of the rows you're operating on before you can start doing writes on the first one, which will slow things down a bit.
Activity
mlucy commentedon Oct 10, 2014
Another option would be to finally do #2156 so that
for_eachcan do multiple writes in parallel.thelinuxlich commentedon Oct 10, 2014
Close to that, but to update/delete a big batch at once would be much more effective
danielmewes commentedon Oct 10, 2014
From the ReQL side this this already possible I think, by using variadic
getAll. For example like this:I'm not sure how well this will actually be parallelized under the hood (@mlucy?).
mlucy commentedon Oct 10, 2014
Even if you do a big batched delete, we break it up into smaller batches internally so that we don't block out other operations while it happens. I think a parallelized
updateinsidefor_eachwould be close as fast as a batchedupdate. If we added a way for writes to be squashed together into batched writes while waiting for the btree, I think it would be just as fast.If the body of the
for_eachis simple, that works too, and should parallelize just fine. The problem with that approach is that you need to evaluate all of the rows you're operating on before you can start doing writes on the first one, which will slow things down a bit.