Re: Batch faulting
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