-
Notifications
You must be signed in to change notification settings - Fork 200
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
getLoginKey Need to optimize #598
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Refer to the code for getLoginKey, as follows:
The deleteAll() operation is not a batch deletion. Instead, delete one by one in the for loop. If there is a lot of user login information, it can greatly affect performance.
For example, in our current scenario, we use an anonymous user to access some interfaces that do not require login before the user logs in, such as the homepage product list. So every day, the login information of this anonymous user can reach several hundred thousand. Once it expires and needs to be deleted, tens of thousands of entries may need to be deleted at once, and then multiple users will come and delete it at the same time. This login interface will time out due to slow deletion.
There are two optimization suggestions:
DELETE from user_ Login_ Key where USER_ ID=? And THRU_ DATE<?
The text was updated successfully, but these errors were encountered: