From 6ccafcb996351d78a1508c4f9c60c98fab2d4480 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sat, 16 May 2009 03:14:23 +0900 Subject: [PATCH] optimize change model - much faster for large decks --- anki/deck.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/anki/deck.py b/anki/deck.py index e6619b7be..8c53c46d8 100644 --- a/anki/deck.py +++ b/anki/deck.py @@ -1316,9 +1316,12 @@ where id in %s""" % ids2str(ids), new=new.id, ord=new.ordinal) self.updateCardQACacheFromIds(factIds, type="facts") self.flushMod() self.updateProgress() - self.updateCardTags() + cardIds = self.s.column0( + "select id from cards where factId in %s" % + ids2str(factIds)) + self.updateCardTags(cardIds) self.updateProgress() - self.updateAllPriorities() + self.updatePriorities(cardIds) self.updateProgress() self.rebuildCounts() self.refresh()