-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Efficiency of "in" with BaseList #1116
Comments
I think your example is broken:
shouldn't it be:
Anyway, I think you're right there we should be able to optimise this. For the moment I've created an unittest to show the trouble (see touilleMan@a02cc83) I think about 2 way of doing this
My guess is solution 2 is more difficult to implement but will likely offer more performances improvements (for example when doing |
Oops, yes, you're completely right. I copied it over incorrectly when markdown-izing it.
This particular case looks like issue #298. But yeah, that would be great to have, too! |
#298 is the way to solve this issue. Let's track the progress there. |
Suppose I have something like this:
Now suppose I do:
The result is correct, but it's less efficient than I thought it would be. I didn't anticipate that doing a "Document in Document.ListField" expression would load cause the items in the ListField to be loaded.
I don't see why the loading needs to occur here. The item_y has an ID (a UUID, in fact). The
container_x._data['items']
is a list of IDs (DBRefs, which are a class and an ID). This should be enough to determine list membership.I think this would just involve writing a BaseList.contains method that checks for this case, but I'm no expert on MongoEngine internals.
The text was updated successfully, but these errors were encountered: