objective c - What is more efficient: One predicate with "IN"-used format or [NSPredicate orPredicateWithSubpredicates:] -
what more efficient?
- using predicate "in" [nspredicate predicatewithformat:@"myobjectid in %@", neededids] ;
- creating bunch of predicates each id ([nspredicate predicatewithformat:@"myobjectid == neededids[i]"]) , using predicates create compound predicate [nspredicate orpredicatewithsubpredicates:peridpredicates]?
i'd prefer first case, because seems cleaner, less code, collegue insist second case compound predicate more efficient (but never heard in wwdcs).
i ask question on apple forums , here i've got: using 'in' more preferable in cases (as expected), because request optimizer have less work do. sure should check coredata logs , instruments.
Comments
Post a Comment