add inidexes based on usage

This commit is contained in:
Neil Johnson 2018-05-01 12:12:57 +01:00
parent 5917562b60
commit d0857702e8

View File

@ -16,10 +16,6 @@
CREATE TABLE user_daily_visits ( user_id TEXT NOT NULL, CREATE TABLE user_daily_visits ( user_id TEXT NOT NULL,
device_id TEXT, device_id TEXT,
user_agent TEXT NOT NULL,
timestamp BIGINT NOT NULL ); timestamp BIGINT NOT NULL );
CREATE INDEX user_daily_visits_uts_idx ON user_daily_visits(user_id, timestamp);
/* What indexes should I include? CREATE INDEX user_daily_visits_ts_idx ON user_daily_visits(timestamp);
* Reads are offline so should optimise for writes
* Need to check if already an entry so user,day
*/