This consists of the following 3 patches:
Narrow columns used in list_revoked_tokens sql
Currently the SQL backend lists revoked tokens by selecting all of the
columns, including the massive "extra" column. This places a significant
burden on the client library and wastes resources. We only need the
id/expired columns to satisfy the API call.
In tests this query was several orders of magnitude faster with just two
thousand un-expired revoked tokens.
(cherry picked from commit ab7221246a)
Add index to cover revoked token list
The individual expires and valid indexes do not fully cover the most
common query, which is the one that lists revoked tokens.
Because valid is only ever used in conjunction with expires, we do not
need it to have its own index now that there is a covering compound
index for expires and valid.
Note that he expires index is still useful alone for purging old tokens
as we do not filter for valid in that case.
(cherry picked from commit dd2c80c566)
Remove unused token.valid index
Because valid is only ever used in conjunction with expires, we do not
need it to have its own index now that there is a covering compound
index for expires and valid.
Note that he expires index is still useful alone for purging old tokens
as we do not filter for valid in that case.
(cherry picked from commit 5d8a1a4142)
Change-Id: I04d62b98d5d760a3fbc3c8db61530f7ebccb0a48
Closes-Bug: #1253755