Tim Abbott
b246723d83
migrations: Add Message indexes on (recipient_id, subject).
...
Our previous set of indexes for the Message table did not contain
anything to optimize queries for all the messages in a topic in an
organization where the same topic name might appear in 10,000s of
messages in many streams.
We add two indexes here to support common queries
* A `(recipient_id, upper(subject), id)` index to support
"Fetch all messages from a topic" queries.
* A `(recipient_id, subject, id)` index to support
"Fetch all messages by topic"
We use the `DESC NULLS last` on both indexes because we almost always
want to query from the "Latest N messages" on a topic, not the
"Earliest N messages".
These indexes dramatically improve the performance of fetching topic
history (which remains not good enough in my opinion; we'll likely
need caching to make it nice), and more importantly make it possible
to check quickly which users have sent messages to a topic for the
"Topics I follow" feature.
Fixes part of #13726 .
2020-04-29 23:11:52 -07:00
..
2020-04-29 10:41:20 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-24 17:03:14 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-24 17:03:14 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-24 17:03:14 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-29 10:41:20 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-22 11:02:32 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-29 10:41:20 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 11:02:34 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-22 11:02:32 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 11:02:34 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 10:41:20 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-04-29 11:02:34 -07:00
2020-04-09 16:43:22 -07:00
2020-04-09 16:43:22 -07:00
2020-03-17 05:41:11 -07:00
2020-04-29 11:02:34 -07:00
2020-04-09 16:02:02 -07:00
2020-04-29 10:41:20 -07:00
2020-04-26 22:13:28 -07:00
2020-04-26 22:39:24 -07:00
2020-04-27 11:29:50 -07:00
2020-04-29 10:41:20 -07:00
2020-04-27 11:29:50 -07:00
2020-04-29 23:11:52 -07:00