speed up deleteDanglingFacts()

This commit is contained in:
Damien Elmes 2009-05-09 03:25:46 +09:00
parent bc7bdc24c4
commit d15dd71b68

View file

@ -1072,7 +1072,7 @@ where factId = :fid and cardModelId = :cmid""",
"Delete any facts without cards. Return deleted ids."
ids = self.s.column0("""
select facts.id from facts
where facts.id not in (select factId from cards)""")
where facts.id not in (select distinct factId from cards)""")
self.deleteFacts(ids)
return ids