diff options
author | Neil Johnson <neil@fragile.org.uk> | 2018-05-01 12:12:57 +0100 |
---|---|---|
committer | Neil Johnson <neil@fragile.org.uk> | 2018-05-01 12:12:57 +0100 |
commit | d0857702e8e22b8bd3dae7fc3cd3718da1e94f19 (patch) | |
tree | 759c0b3eb8b4fcf9252ca6ba9cc87a724bb4dd97 /synapse/storage | |
parent | 10 mins seems more reasonable that every minute (diff) | |
download | synapse-d0857702e8e22b8bd3dae7fc3cd3718da1e94f19.tar.xz |
add inidexes based on usage
Diffstat (limited to 'synapse/storage')
-rw-r--r-- | synapse/storage/schema/delta/49/add_user_daily_visits.sql | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/synapse/storage/schema/delta/49/add_user_daily_visits.sql b/synapse/storage/schema/delta/49/add_user_daily_visits.sql index 11356a97fc..3dd478196f 100644 --- a/synapse/storage/schema/delta/49/add_user_daily_visits.sql +++ b/synapse/storage/schema/delta/49/add_user_daily_visits.sql @@ -16,10 +16,6 @@ CREATE TABLE user_daily_visits ( user_id TEXT NOT NULL, device_id TEXT, - user_agent TEXT NOT NULL, timestamp BIGINT NOT NULL ); - -/* What indexes should I include? - * Reads are offline so should optimise for writes - * Need to check if already an entry so user,day - */ +CREATE INDEX user_daily_visits_uts_idx ON user_daily_visits(user_id, timestamp); +CREATE INDEX user_daily_visits_ts_idx ON user_daily_visits(timestamp); |