Core Data / NSPredicate - faster alternative to JOIN?
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