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
1 changed files with 3 additions and 1 deletions
|
@ -493,7 +493,9 @@ class RegistrationWorkerStore(SQLBaseStore):
|
|||
"""
|
||||
|
||||
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+):")
|
||||
|
||||
|
|
Loading…
Reference in a new issue