mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 23:12:21 -04:00
add temporary index for priority
This commit is contained in:
parent
05f60c49c8
commit
fe97616ecd
1 changed files with 11 additions and 1 deletions
12
anki/deck.py
12
anki/deck.py
|
@ -69,7 +69,7 @@ SEARCH_FIELD = 6
|
||||||
SEARCH_FIELD_EXISTS = 7
|
SEARCH_FIELD_EXISTS = 7
|
||||||
SEARCH_QA = 8
|
SEARCH_QA = 8
|
||||||
SEARCH_PHRASE_WB = 9
|
SEARCH_PHRASE_WB = 9
|
||||||
DECK_VERSION = 55
|
DECK_VERSION = 56
|
||||||
|
|
||||||
deckVarsTable = Table(
|
deckVarsTable = Table(
|
||||||
'deckVars', metadata,
|
'deckVars', metadata,
|
||||||
|
@ -3750,6 +3750,11 @@ create index if not exists ix_cards_typeCombined on cards
|
||||||
deck.s.statement("""
|
deck.s.statement("""
|
||||||
create index if not exists ix_cards_relativeDelay on cards
|
create index if not exists ix_cards_relativeDelay on cards
|
||||||
(relativeDelay)""")
|
(relativeDelay)""")
|
||||||
|
# priority - temporary index to make compat code faster. this can be
|
||||||
|
# removed when all clients are on 1.2, as can the ones below
|
||||||
|
deck.s.statement("""
|
||||||
|
create index if not exists ix_cards_priority on cards
|
||||||
|
(priority)""")
|
||||||
# failed cards, review early - obsolete
|
# failed cards, review early - obsolete
|
||||||
deck.s.statement("""
|
deck.s.statement("""
|
||||||
create index if not exists ix_cards_duePriority on cards
|
create index if not exists ix_cards_duePriority on cards
|
||||||
|
@ -4295,6 +4300,11 @@ update fieldModels set quizFontFamily = 'Arial' where not quizFontFamily
|
||||||
or quizFontFamily is null""")
|
or quizFontFamily is null""")
|
||||||
deck.version = 55
|
deck.version = 55
|
||||||
deck.s.commit()
|
deck.s.commit()
|
||||||
|
if deck.version < 56:
|
||||||
|
# add an index for priority
|
||||||
|
DeckStorage._addIndices(deck)
|
||||||
|
deck.version = 56
|
||||||
|
deck.s.commit()
|
||||||
# executing a pragma here is very slow on large decks, so we store
|
# executing a pragma here is very slow on large decks, so we store
|
||||||
# our own record
|
# our own record
|
||||||
if not deck.getInt("pageSize") == 4096:
|
if not deck.getInt("pageSize") == 4096:
|
||||||
|
|
Loading…
Reference in a new issue