English 中文(简体)
Fetch Request是否建议过批量错?
原标题:Does the Fetch Request do the recommended batch faulting?

我很奇怪。 docs果在docs中说:

Core Data automatically fires faults when necessary (when a persistent property of a fault is accessed). However, firing faults individually can be inefficient, and there are better strategies for getting data from the persistent store (see “Batch Faulting and Pre-fetching with the SQLite Store”).

NSFetchRequest有以下特点:

[fetchRequest setFetchBatchSize:20];

这是否基本上像建议那样做这种争执?

就其他人而言,错失并不意味着“陷入错误”,而是意味着“使错误变得重要”,就像“摆脱错误”。 在我看来,措辞大错,但至少在docs中是一致的;

最佳回答

文件回答了这一问题,海事组织:

If you set a non-zero batch size, the collection of objects returned when the fetch is executed is broken into batches. When the fetch is executed, the entire request is evaluated and the identities of all matching objects recorded, but no more than batchSize objects’ data will be fetched from the persistent store at a time. The array returned from executing the request will be a proxy object that transparently faults batches on demand. (In database terms, this is an in-memory cursor.)

对我来说,这说明,它把单列结果分成在接触任何批量成员时出现过错的批量。

问题回答

Batch Faulting

你看到的 Apple果 fault断建议是另一个案例,而不是小批量。

你们有一堆错,你们想要在一片 lo中找到自己的财产。 每次都将发生过失。 此前,你曾提出过这样的要求:

NSFetchRequest *request = ...;
NSArray *arrayOfFaults = @[faultOne, faultTwo, ...];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF IN %@", arrayOfFaults];
[request setPredicate:predicate];
[request setReturnsObjectsAsFaults:NO];

不仅核心数据可以检索其内部藏匿处的所有数据(由于提出要求),而且还可以退回全部已实现的物体(通过<代码>查询。

Relationship Pre-Fetching

缩略语 然后,你将她们 it,在每间休息室,就有一名雇员。 每当一个部门进入时,就会发生关系错。 为避免这种情况,你将这样的请求混为一谈:

[request setRelationshipKeyPathsForPrefetching:@[@"department"]];




相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。

热门标签