From 2393775f80f4b6d05910cc51acdbc9bedebf66b6 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 23 Apr 2009 04:05:37 +0900 Subject: [PATCH] add type to factid index --- anki/deck.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/anki/deck.py b/anki/deck.py index 13ca7fd41..32bb66629 100644 --- a/anki/deck.py +++ b/anki/deck.py @@ -2601,7 +2601,7 @@ create index if not exists ix_cards_duePriority on cards (type, isDue, combinedDue, priority)""") # card spacing deck.s.statement(""" -create index if not exists ix_cards_factId on cards (factId)""") +create index if not exists ix_cards_factId on cards (factId, type)""") # stats deck.s.statement(""" create index if not exists ix_stats_typeDay on stats (type, day)""") @@ -3010,8 +3010,10 @@ nextFactor, reps, thinkingTime, yesCount, noCount from reviewHistory""") deck.version = 33 deck.s.commit() if deck.version < 34: - deck.updateDynamicIndices() deck.s.execute("drop view if exists acqCardsRandom") + deck.s.execute("drop index if exists ix_cards_factId") + DeckStorage._addIndices(deck) + deck.updateDynamicIndices() deck.version = 34 deck.s.commit() # executing a pragma here is very slow on large decks, so we store