• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Core Data / NSPredicate - faster alternative to JOIN?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Core Data / NSPredicate - faster alternative to JOIN?


  • Subject: Core Data / NSPredicate - faster alternative to JOIN?
  • From: Jim Correia <email@hidden>
  • Date: Wed, 17 May 2006 21:29:16 -0400

The predicate programming guide points out that JOINs are expensive operations and should be avoided where possible.

Suppose I have the following entities:

Student
Course

Student has a to-many relationship to course with an appropriate inverse relationship. I'd like to quickly determine which students have no courses assigned.

A fetch request for the Student entity with a predicate of "courses.@count == 0" gives me the answer I'm looking for, but it is relatively expensive. (No surprise - the docs said it would be.)

Can I write a predicate which avoids the join?

Any other way to get the result more efficiently?

Thanks,
Jim

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: what's an easy way to use NSBrowser?
  • Next by Date: Re: Making newly inserted row visible in NSTableView
  • Previous by thread: Core Data fails to retrieve all data
  • Next by thread: CoreData vs. SQLite for Multi-User Simultaneous Access
  • Index(es):
    • Date
    • Thread