-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Drop authtoken_version_index #25217
Drop authtoken_version_index #25217
Conversation
Could you describe the problem here in a bit more detail? |
It was a cold winter night. The wind was howling around the house. It was a night as you know from the movies right before something terrible happens. It was a night like this I was going over a slow query log. Here I noticed that there were several long running queries looking like: DELETE FROM `oc_authtoken`
WHERE (`last_activity` < 1609316716)
AND (`type` = 0)
AND (`remember` = 1)
AND (`version` = 2); I should have known better. But again as in the movies I walked right into the darkness of the database. And I ran an EXPLAIN on this query. Which showed me there were two indexies on this table that could be used: |
Now there is only the one that is triggered by This one is usually called by the delete client API for OAuth2 and thus not that often like the one you mentioned above. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me squash and then this looks good 👍
The index was used when deleting old tokens. On top of that the index is of course not that great since the version is either 1 or 2. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
c1fd9af
to
3d61adc
Compare
Yeah but for that a new index on name would probably make sense. |
The index was used when deleting old tokens. On top of that the index is
of course not that great since the version is either 1 or 2.
Signed-off-by: Roeland Jago Douma roeland@famdouma.nl