开发者

Core Data: Search for existence of a single word

I have an iPhone Core Data database with over 170,000 words in it. Just words, nothing else. When I preform a pretty complex regular expression fetch, it only takes about 10 seconds to get the returned results. Yet when I use a predicate like below, it takes about 7 seconds. Shouldn't it take far less than that amount of time to complete the request? With the below example I'm simply checking 开发者_JS百科that the particular word, in this case "apple" exists in the database. Is there a better way to do this?

NSPredicate *predicate = [NSPredicate predicateWithFormat:@"word LIKE 'apple'"];


[NSPredicate predicateWithFormat:@"'apple' <=  word AND word < 'applf'"];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜