0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-11-04 05:38:57 +01:00

Add index on events (topological_ordering, stream_ordering) to help with ORDER BY clauses

This commit is contained in:
Erik Johnston 2015-04-15 11:43:25 +01:00
parent 6606f7c659
commit cce5d057d3
2 changed files with 2 additions and 0 deletions

View file

@ -0,0 +1 @@
CREATE INDEX events_order ON events (topological_ordering, stream_ordering);

View file

@ -29,6 +29,7 @@ CREATE TABLE IF NOT EXISTS events(
CREATE INDEX events_stream_ordering ON events (stream_ordering); CREATE INDEX events_stream_ordering ON events (stream_ordering);
CREATE INDEX events_topological_ordering ON events (topological_ordering); CREATE INDEX events_topological_ordering ON events (topological_ordering);
CREATE INDEX events_order ON events (topological_ordering, stream_ordering);
CREATE INDEX events_room_id ON events (room_id); CREATE INDEX events_room_id ON events (room_id);