mirror of https://github.com/zulip/zulip.git
analytics: Better indexed join to analytics_usercount, using realm_id.
analytics_usercount_property_realm_id_end_time_591dbec1_idx, added back inb7df84d5a8
, makes this lookup actually indexed.195defb031
rewrote this query in a way which stopped using the index.
This commit is contained in:
parent
a88445a6d2
commit
94795500b5
|
@ -768,6 +768,7 @@ def count_realm_active_humans_query(realm: Realm | None) -> QueryFn:
|
|||
AND end_time = %(time_end)s
|
||||
) active_usercount
|
||||
JOIN zerver_userprofile ON active_usercount.user_id = zerver_userprofile.id
|
||||
AND active_usercount.realm_id = zerver_userprofile.realm_id
|
||||
JOIN (
|
||||
SELECT DISTINCT ON (modified_user_id)
|
||||
modified_user_id, event_type
|
||||
|
|
Loading…
Reference in New Issue