Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Speed up background jobs populate_full_user_id_user_filters and populate_full_user_id_profiles #15700

Merged
merged 2 commits into from
May 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/15700.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Speed up background jobs `populate_full_user_id_user_filters` and `populate_full_user_id_profiles`.
2 changes: 1 addition & 1 deletion synapse/storage/databases/main/filtering.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def _get_last_id(txn: LoggingTransaction) -> Optional[str]:
SELECT user_id FROM user_filters
WHERE user_id > ?
ORDER BY user_id
LIMIT 1 OFFSET 50
LIMIT 1 OFFSET 1000
"""
txn.execute(sql, (lower_bound_id,))
res = txn.fetchone()
Expand Down
2 changes: 1 addition & 1 deletion synapse/storage/databases/main/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def _get_last_id(txn: LoggingTransaction) -> Optional[str]:
SELECT user_id FROM profiles
WHERE user_id > ?
ORDER BY user_id
LIMIT 1 OFFSET 50
LIMIT 1 OFFSET 1000
"""
txn.execute(sql, (lower_bound_id,))
res = txn.fetchone()
Expand Down