objective c - What is more efficient: One predicate with "IN"-used format or [NSPredicate orPredicateWithSubpredicates:] -


what more efficient?

  1. using predicate "in" [nspredicate predicatewithformat:@"myobjectid in %@", neededids] ;
  2. 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.

https://devforums.apple.com/message/1125377#1125377


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -