On Dec 8, 2008, at 14:47, Luke Evans wrote:

Thanks for the reply Melissa - much appreciated.

I was beginning to toy with the idea of trying a function expression (which I have used before for other purposes) to isolate an individual attribute object and perform the several comparisons therein. Presumably SUBQUERY, being designed for the job, benefits from some performance advantages over the function approach(?).

Regards

Luke

It depends on the query/dataset. There's no real way to tell until you run against a sample that's a good approximation the data your application will be working with. That sounds kind of fluffy, but as with most things, it's a tradeoff between the time spent doing the joins and the time it would take to do the fetch differently, which usually involves additional IO or in-memory computation. Subqueries are supported natively by CoreData/SQLite, so you do avoid a lot of the object instantiation you'd be dealing with if you were postprocessing the potential results (the set of objects without the correlated subquery) in memory.

Another option is to invert the query: fetch all the destination objects which meet your criteria for the destination, set the request to prefetch the relationship you're actually interested in, then do a second fetch with (targetObjects IN [EMAIL PROTECTED]) and includesPropertyValues set to NO (the data is already in the row cache at this point).

Cheers,
+Melissa

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to