title: Core Data - complex fetch
body: <p>This is my core data model:</p>
  
  <pre><code>Conference
  ==========
  name
  
  events (to-many relationship to Event object)
  
  Event
  ======
  date
  type (int - private=0, public=1)
  
  conference (to-one relationship to Conference object)
  </code></pre>
  
  <p>So conference can have many events, and event has only one conference:  </p>
  
  <pre><code>Conference &lt;------&gt;&gt; Event
  </code></pre>
  
  <p>I have a complex fetch that I'm not sure how to do, this is what I need:  </p>
  
  <p>The 3 top conferences with the most public events AND meet the basic conditions, meaning:<br>
  1. conference has at least 1 private event.<br>
  2. conference has at least 5 public event.<br>
  3. should be calculated based on the last 10 days    </p>
  
  <p>I'm not sure if I should query the <code>Conference</code> objects directly or query the <code>Event</code> objects and than filter the appropriate conferences using event.conference</p>
  
  <p>Efficiency is important, so if possible to use fetch limit or other optimization.</p>