-
Notifications
You must be signed in to change notification settings - Fork 113
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
switch takes ages #72
Comments
@gshilin have you encountered memory issues like |
@gshilin @sergey-alekseev on README, I mentioned "If there are too many users (on production), the switch_user_select is not a good choice, you should call the switch user request by yourself.", you can build an input text field, fuzzy search users by ajax, then call the switch user request. |
I don't use switch_user_select. The problem is in switch_user_controller#handle_request where the following line record = SwitchUser.data_sources.find_scope_id(params[:scope_identifier]) loads ALL users. |
+1, this generates a |
SwitchUser.all_users only selects identifier and name columns. SwitchUser.find_scope_id only queries that user.
SwitchUser.all_users only selects identifier and name columns. SwitchUser.data_sources.find_scope_id only queries that user.
it should already be fixed in master branch, could you try it? |
Yes, it works now, thank you |
I've got around 400,000 users and switch takes ages.
It also tries to load all of these users into memory.
Any ideas?
The text was updated successfully, but these errors were encountered: