-
Notifications
You must be signed in to change notification settings - Fork 24
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
Fix #47: avoid query where possible in Garner::Mixins::Mongoid::Identity. #48
Conversation
Thanks a ton for catching and fixing this. It was a serious performance problem on larger collections, and great to have it fixed. I'm inclined to suggest that we stick with just the one-line solution for now, as it provides 99.9...% of the performance improvement, and I'm irrationally cautious against introducing more code changes that could have unanticipated effects that we haven't thought of. Here are the
|
Two index lookups are exactly twice as slow. I don't really see why we would want to do it, but I also see how this looks a big hacky. I'll do what you say and keep the fix here as a monkey patch in our project. |
Technically, thanks to the
Also, it's not actually "twice as slow" because an |
Closing for #49. |
Try to simplify the conditions depending on how many items we have in
mongoid_identity_fields
and what they are.