mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
zilencer: Add index on RemoteInstallationCount for remote activity.
When profiling the database query in `remote_activity.py`, push_forwarded_count was identified as an expensive part of the overall work. Adds an index on RemoteInstallationCount so this is more efficient.
This commit is contained in:
committed by
Tim Abbott
parent
78f90860b2
commit
47a5459637
@@ -373,6 +373,13 @@ class RemoteInstallationCount(BaseRemoteCount):
|
||||
name="unique_remote_installation_count_server_id_remote_id",
|
||||
),
|
||||
]
|
||||
indexes = [
|
||||
models.Index(
|
||||
fields=["server_id", "end_time"],
|
||||
condition=Q(property="mobile_pushes_forwarded::day"),
|
||||
name="zilencer_remoteinstallationcount_server_end_time_mobile_pushes_forwarded",
|
||||
)
|
||||
]
|
||||
|
||||
@override
|
||||
def __str__(self) -> str:
|
||||
|
Reference in New Issue
Block a user