用 Edit distance 做 Spell Checking

我想問下, 如果用 edit distance 做 spell checking, 咁 spell checking 對的可能係一百萬隻 record, 有無咩方法可以 cache 左database 的record 的 partial edit distance?