mirror of
https://mau.dev/maunium/synapse.git
synced 2024-11-11 20:42:23 +01:00
Merge pull request #5770 from matrix-org/erikj/fix_current_state_event_sqlite
Fix current_state bg update to work on old SQLite
This commit is contained in:
commit
2a12d76646
3 changed files with 6 additions and 4 deletions
|
@ -49,14 +49,15 @@ steps:
|
||||||
|
|
||||||
|
|
||||||
- command:
|
- command:
|
||||||
- "python -m pip install tox"
|
- "apt-get update && apt-get install -y python3.5 python3.5-dev python3-pip libxml2-dev libxslt-dev zlib1g-dev"
|
||||||
|
- "python3.5 -m pip install tox"
|
||||||
- "tox -e py35-old,codecov"
|
- "tox -e py35-old,codecov"
|
||||||
label: ":python: 3.5 / SQLite / Old Deps"
|
label: ":python: 3.5 / SQLite / Old Deps"
|
||||||
env:
|
env:
|
||||||
TRIAL_FLAGS: "-j 2"
|
TRIAL_FLAGS: "-j 2"
|
||||||
plugins:
|
plugins:
|
||||||
- docker#v3.0.1:
|
- docker#v3.0.1:
|
||||||
image: "python:3.5"
|
image: "ubuntu:xenial" # We use xenail to get an old sqlite and python
|
||||||
propagate-environment: true
|
propagate-environment: true
|
||||||
retry:
|
retry:
|
||||||
automatic:
|
automatic:
|
||||||
|
|
1
changelog.d/5770.misc
Normal file
1
changelog.d/5770.misc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Reduce database IO usage by optimising queries for current membership.
|
|
@ -870,10 +870,10 @@ class RoomMemberStore(RoomMemberWorkerStore):
|
||||||
next_room, = row
|
next_room, = row
|
||||||
|
|
||||||
sql = """
|
sql = """
|
||||||
UPDATE current_state_events AS c
|
UPDATE current_state_events
|
||||||
SET membership = (
|
SET membership = (
|
||||||
SELECT membership FROM room_memberships
|
SELECT membership FROM room_memberships
|
||||||
WHERE event_id = c.event_id
|
WHERE event_id = current_state_events.event_id
|
||||||
)
|
)
|
||||||
WHERE room_id = ?
|
WHERE room_id = ?
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue