title: Core Data to-one relationship - is foreign reference indexed?
body: <p>I'd like to apply a filter to child objects belonging to a set of parent objects in a list.</p>
  
  <p>So take example Person and PersonInterest. Relationship Person&lt;-->>PersonInterest. PersonInterest only has one property that maps to an enum value (small number).</p>
  
  <p>I have a huge store database and have hand-picked a few Person objects and have their ObjectIDs in an array. Now I want to filter on those having a given interest identified as say 1.</p>
  
  <p>Predicates could be 
  1)fetch PersonInterest</p>
  
  <pre><code>@"(person IN %@) AND (interestType == 1)",personObjectIDList
  </code></pre>
  
  <p>2)or fetch Person</p>
  
  <pre><code>@"(self IN %@) AND (ANY personInterests.interestType == 1)",personObjectIDList
  </code></pre>
  
  <p>Given that each person has an average of 5 interests, are both queries efficient?</p>
  
  <p>I may later want to match on a multiple interests so query 2 is my preferred choice e.g.:</p>
  
  <pre><code>@"(self IN %@) AND (ANY personInterests.interestType IN (1,2))",personObjectIDList //this may not work due to predicate restrictions for to-many
  </code></pre>
  
  <p>..... and how would these compare to a property on Person storing a JSON list of interestTypes where I pad with first and last elements 0 (e.g. '[0,1,4,3,0]' ):</p>
  
  <pre><code>@"(self IN %@) AND (jsonInterestType like '*,1,*')",personObjectIDList
  </code></pre>