I was reading the docs on core data looking to speed up my search. I found the following and was slightly confused as to what it meant:
The SQL store, on the other hand, compiles the predicate and sort descriptors to SQL and evaluates the result in the database itself. This is done primarily for performance—databases are much faster at this (it's what they're designed for)—but it means that evaluation happens in a non-Cocoa environment, and so sort descriptors (or predicates) that rely on Cocoa cannot work. The supported sort selectors are compare: and caseInsensitiveCompare:. Note that in addition you cannot sort on transient properties using the SQLite store.
Does this mean that they recommend that one not use predicates or sort descriptors when fetching managed objects from an sqlite store?
I currently have a FetchRequest where I pass the following:
NSPredicate *thingSearchPredicate =
[NSPredicate predicateWithFormat:@"label BEGINSWITH[cd] %@", searchText];
NSSortDescriptor *sortDescriptor =
[[NSSortDescriptor alloc] initWithKey:@"label" ascending:YES];
The search works but I think I am using a predicate that relies on cocoa. BEGINSWITH is I assume a compare:options:range: shorthand where range is search string length. The fact that is is diacritic insensitive definitely seems to countermand the advice above so does that just mean that they are evaluated automatically for me after all instances of that entity have been fetched?
Are there any other ways to speed up search?