mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-10-01 11:49:51 -04:00
Merge pull request #6148 from matrix-org/erikj/find_next_generated
Bound find_next_generated_user_id DB query.
This commit is contained in:
commit
5d8ffdfe61
1
changelog.d/6148.misc
Normal file
1
changelog.d/6148.misc
Normal file
@ -0,0 +1 @@
|
|||||||
|
Improve performance of `find_next_generated_user_id` DB query.
|
@ -493,7 +493,9 @@ class RegistrationWorkerStore(SQLBaseStore):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def _find_next_generated_user_id(txn):
|
def _find_next_generated_user_id(txn):
|
||||||
txn.execute("SELECT name FROM users")
|
# We bound between '@1' and '@a' to avoid pulling the entire table
|
||||||
|
# out.
|
||||||
|
txn.execute("SELECT name FROM users WHERE '@1' <= name AND name < '@a'")
|
||||||
|
|
||||||
regex = re.compile(r"^@(\d+):")
|
regex = re.compile(r"^@(\d+):")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user