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'"];
精彩评论