New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calling .getAll()
with a large number of keys is not efficient
#4218
Comments
The latter is faster? This is sad :( |
@thelinuxlich well, like I said, the first one never finishes executing (as far as I can tell). The |
Thanks for opening an issue about this @marshall007 .
The fact that your query example is so much slower with a |
@danielmewes -- it's possible that If that is the case and you start on a fix, be careful to think about the case where you union 8k changefeeds that never receive a document with 1 changefeed that does (i.e. in the changefeed case we can't just block on a subset of the streams indefinitely). |
Another thing I meant to mention is that while running this query most other operations fail (i.e. I can't create new connections and queries on existing connections time out). Also the |
That makes me pretty sure that the problem is we're spawning ~8k reads in parallel rather than throttling them. We should probably throttle calls to |
Oh wait I forgot you changed |
It sounds like you guys have it figured out, but I just confirmed this is a regression. I was able to run the |
Oh that's pretty bad. Thanks for checking @marshall007 . |
A fix like the one suggested by @mlucy is implemented in branch daniel_4218 and in code review 2879. This leaves the behavior for changefeeds unchanged, but should fix the problem for non-changefeed In a quick test this reduced the amount of memory used by a |
Discussed with @AtnNn on IRC. I'm trying to delete ~8k documents using
.getAll()
on a secondary index. The table has ~19k total docs. I've tried to run the following query several times (for at most 5m), but I've yet to see it run to completion:Replacing
.delete()
with.count()
finishes in ~7.5s. Based on our discussion and the things I've tried, I don't think it has anything to do withr.http
, but rather is simply.getAll()
being less efficient with a large number of keys. Also, as suggested by @AtnNn, this works:The text was updated successfully, but these errors were encountered: