mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
There is no reason to have an index on just `realm_id` or `remote_id`, as those values mean nothing outside of the scope of a specific `server_id`. Remove those never-used single-column indexes from the two tables that have them. By contrast, the pair of `server_id` and `remote_id` is quite useful and specific -- it is a unique pair, and every POST of statistics from a remote host requires looking up the highest `remote_id` for a given `server_id`, which (without this index) is otherwise a quite large scan. Add a unique constraint, which (in PostgreSQL) is implemented as a unique index.
ZILENCER -- The Zulip license manager
This app is the place for storing state about various deployments of Zulip that exist in the world.