• 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
Re: Batch faulting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Batch faulting


  • Subject: Re: Batch faulting
  • From: Miguel Sanchez <email@hidden>
  • Date: Wed, 16 Nov 2005 15:20:02 -0800

From http://developer.apple.com/documentation/Cocoa/Conceptual/ CoreData/Articles/cdFetching.html#//apple_ref/doc/uid/TP40002484

---
Batch Faulting

Sometimes a number of objects may be represented by faults. If each fault is fired individually, then Core Data performs a separate round trip to the persistent store for each. This incurs a comparatively high overhead. Instead, you can "batch fault" a collection of objects by executing a fetch request using a predicate with an IN operator, as illustrated in the following example.

NSArray *array = [NSArray arrayWithObjects:fault1, fault2, ..., nil];

NSPredicate *predicate = [NSPredicate predicateWithFormat:@"self IN % @", array];

(In a predicate, self represents the object being evaluated—see Predicate Format String Syntax.


---

- Miguel

On Nov 16, 2005, at 3:51 AM, Timothy Larkin wrote:

A certain fetch across a relationship through approximately 4 thousand objects takes 25 seconds the first time I execute it. The second time it happens almost instantaneously. I suspect this is a caching problem. Retaining the objects in an array, and then filtering the array reduces the initial search to about 15 seconds.

Is there any trick I can exploit to reduce the time of the initial fetch or filter?


-- Timothy Larkin Abstract Tools Caroline, NY

_______________________________________________
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

_______________________________________________ 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
  • Follow-Ups:
    • Re: Batch faulting
      • From: Timothy Larkin <email@hidden>
References: 
 >Batch faulting (From: Timothy Larkin <email@hidden>)

  • Prev by Date: Re: Displaying image and core data
  • Next by Date: Example code for SOAP requests with attachments
  • Previous by thread: Batch faulting
  • Next by thread: Re: Batch faulting
  • Index(es):
    • Date
    • Thread