Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3251 from matrix-org/cohort_analytics
Browse files Browse the repository at this point in the history
Tighter filtering for user_daily_visits
  • Loading branch information
neilisfragile authored May 21, 2018
2 parents d689e0d + 644aac5 commit 4aac889
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion synapse/storage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,11 @@ def _generate_user_daily_visits(txn):
WHERE timestamp = ?
) udv
ON u.user_id = udv.user_id AND u.device_id=udv.device_id
WHERE last_seen > ? AND last_seen <= ? AND udv.timestamp IS NULL
INNER JOIN users ON users.name=u.user_id
WHERE last_seen > ? AND last_seen <= ?
AND udv.timestamp IS NULL AND users.is_guest=0
AND users.appservice_id IS NULL
GROUP BY u.user_id, u.device_id
"""

# This means that the day has rolled over but there could still
Expand Down

0 comments on commit 4aac889

Please sign in to comment.