perf(threads): Add an index specifically for the "starred" view

This commit is contained in:
Ben Gotow 2016-02-04 20:13:49 -08:00
parent 57cfd07bbe
commit 90336f4f1f

View file

@ -100,7 +100,8 @@ class Thread extends Model
@additionalSQLiteConfig:
setup: ->
['CREATE INDEX IF NOT EXISTS ThreadListIndex ON Thread(last_message_received_timestamp DESC, id)']
['CREATE INDEX IF NOT EXISTS ThreadListIndex ON Thread(last_message_received_timestamp DESC, id)',
'CREATE INDEX IF NOT EXISTS ThreadStarIndex ON Thread(account_id, starred)']
fromJSON: (json) ->
super(json)