mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-28 15:08:49 +03:00
Add missing index to access_tokens
table (#17045)
This was causing sequential scans when using refresh tokens.
This commit is contained in:
parent
51776745b9
commit
31122b71bc
2 changed files with 8 additions and 0 deletions
1
changelog.d/17045.misc
Normal file
1
changelog.d/17045.misc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Improve database performance by adding a missing index to `access_tokens.refresh_token_id`.
|
|
@ -2266,6 +2266,13 @@ class RegistrationStore(StatsStore, RegistrationBackgroundUpdateStore):
|
||||||
):
|
):
|
||||||
super().__init__(database, db_conn, hs)
|
super().__init__(database, db_conn, hs)
|
||||||
|
|
||||||
|
self.db_pool.updates.register_background_index_update(
|
||||||
|
update_name="access_tokens_refresh_token_id_idx",
|
||||||
|
index_name="access_tokens_refresh_token_id_idx",
|
||||||
|
table="access_tokens",
|
||||||
|
columns=("refresh_token_id",),
|
||||||
|
)
|
||||||
|
|
||||||
self._ignore_unknown_session_error = (
|
self._ignore_unknown_session_error = (
|
||||||
hs.config.server.request_token_inhibit_3pid_errors
|
hs.config.server.request_token_inhibit_3pid_errors
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue