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. |
MorrisJobke
left a comment
There was a problem hiding this comment.
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