mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
PERF: user imports would slow down the more users were imported
This commit is contained in:
@ -390,7 +390,8 @@ class ImportScripts::Base
|
||||
end
|
||||
|
||||
def find_existing_user(email, username)
|
||||
User.joins(:user_emails).where("user_emails.email = ? OR username = ?", email.downcase, username).first
|
||||
# Force the use of the index on the 'user_emails' table
|
||||
UserEmail.where("lower(email) = ?", email.downcase).first&.user || User.where(username: username).first
|
||||
end
|
||||
|
||||
def created_category(category)
|
||||
|
Reference in New Issue
Block a user