Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Add an index to make membership queries faster #1867
Conversation
erikjohnston
assigned
NegativeMjark
Jan 31, 2017
| + self.CURRENT_STATE_INDEX_UPDATE_NAME, | ||
| + index_name="current_state_events_member_index", | ||
| + table="current_state_events", | ||
| + columns=["state_key"], |
NegativeMjark
Feb 1, 2017
•
Contributor
Oh I see, this for rooms_for_user so you want to look up by user_id = state_key.
erikjohnston
Feb 1, 2017
Owner
No because we're looking up the room. The query we're optimising is essentially:
SELECT * FROM current_state_events WHERE type = 'm.room.member' AND state_key = ?The type is in the where clause.
NegativeMjark
Feb 1, 2017
Contributor
And the users_in_room is already handled by the (room_id, type, state_key) index.
erikjohnston
merged commit 88a4d54
into
develop
Feb 1, 2017
8 checks passed
Sytest Dendron (Commit)
Build #1450 origin/erikj/member_index succeeded in 10 min
Details
Sytest Dendron (Merged PR)
Build finished.
Details
Sytest Postgres (Commit)
Build #2267 origin/erikj/member_index succeeded in 5 min 44 sec
Details
Sytest Postgres (Merged PR)
Build finished.
Details
Sytest SQLite (Commit)
Build #2336 origin/erikj/member_index succeeded in 5 min 57 sec
Details
Sytest SQLite (Merged PR)
Build finished.
Details
continuous-integration/travis-ci/pr
The Travis CI build passed
Details
continuous-integration/travis-ci/push
The Travis CI build passed
Details
erikjohnston
deleted the
erikj/member_index
branch
Mar 29, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
erikjohnston commentedJan 31, 2017
No description provided.