Commit Graph

1 Commits

Author SHA1 Message Date
Alex Vandiver
33e1d583bf messages: Add new conditional versions of subject indexes.
Indexes on topic ("subject") are polluted by the existence of DMs,
which all have empty topics, and as such skew the statistics greatly.
This is particularly important given the new use of the empty topic
for the "general chat" function -- left as-is, the database makes bad
query plans because it believes the topic is vastly more common than
it actually is.

We move the old indexes to a new name with `_all`, and
recreate (concurrently) the same indexes but with a condition on
is_channel_message.  These new indexes are unused at current, until
the query-building logic adds limits on is_channel_message; see the
following commit.
2025-03-18 09:34:11 -07:00