mirror of
https://mau.dev/maunium/synapse.git
synced 2024-08-31 06:32:11 +00:00
Bound find_next_generated_user_id DB query.
We can easily bound the set of user IDs we pull out of the DB, so lets do that.
This commit is contained in:
parent
ecd254bc49
commit
d69fd53f74
@ -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