In the model, I have two entities: records and categories with records through distorted relationships range from one to many it occurs. The store is continuously of Sqlite and DB is not so small, approximately 23 MB (records of 17).
I use a list-extension design to show the record table and detailed record view. The list view controller uses the NSFetchedResultsController.
If I do not use setFetchBatchSize, then
Core Data: Annotation: Get SQL Connection Time: 15.8800 Core Data: Annotation: Total Fetch Execution Time: 17028 Lines For 16.998
OMG!
If I use setFetchBatchSize: 25, everything works great again:
CoreData: Annotation: Getting SQL Connection Time: 1.1736 Corodata: Annotation : Total fetch performance time: 1.1 9 00 for 17028 lines.
Yes, it would be great! but it's not like that! The controller in the list view, when the user taps a record, I assign a detailed view controller and I pass the records on indexPath in fetchedResultsController:
- (zero) table view : (UITableView *) The tableview was SelectionRowAtIndexPath: (NSINxpath *) IndexPath {record * record = (record *) [fetchedResultsController objectAtindexpath: indexpath]; RecordViewController * RecordviewConverter = [[RecordViewCentorAbent] init]; RecordViewController.record = record; [Self. Navigation controller Push ViewController: Animated Audit Viewer: Yes]; [Record Week Controller Release]; }
Now, in the expanded view, the controller, I have a record favorite or not:
- (IBAction) setFavorite {if (! ISAFAR Intelligence]] [Record Set Value: [NSNM Number Number] for 1: @ "ISAFAV"]; Other [Record Set Value: [NSNumber NumberHatah: 0] for Key: @ "ISFAV"]; ### Save the Contact Here ###}
OK, are you ready? If I tap on the first record in the list, then I add or remove it like this, it is in 0.0046 seconds immediately! The console only shows the update statement with SQL debug mode:
CoreData: SQL: BEGIN Exclusive Cordata: SQL: Sureer SetJesave = ?, ZOOPT =? Where Z_PK =? And Z_OPT =? CoreData: SQL: CommitCoradata: Annotation: SQL Execution Time: 0.0046S
If I scroll the large list very quickly (and I clearly find batch requests on the console) When I tap a record with several batch requests and I remove it from favorites, many many (many more! The more I scroll, the more I scroll!) The selection statement appears before UPDATE one in the console . This means that total execution time is not acceptable (Ubaton freeze for long time on IIT).
What's going on? The problem is explicitly related to the batch requests that are related to more fetch requests = Select more before the UPDATE statement statement it is one of them:
Cordata: sql: SELECT 0, t0.Z_PK, T0.Z_OPT, t0.ZCONTENT, t0.ZCONTENT2, t0.ZISUSER, t0.ZISFAV, t0.ZTITLE, T0.ZTITLE2, t0.ZID, t0.ZAUTHOR, t0.ZCATEGORY Zrecord from t0 where t0.Z_PK IN (?,
If I remove setFetchBatchSize, then no problem (but startup 16 seconds is required). It seems that when I update the assets ISAVA, Coradat Again, all the fashion configurations are needed which were necessary to reach that record, even though I passed the controller to see that record in detail in the form of an object.
Post, I Trying to be as clear as possible. Thank you very much, I'm driving myself crazy ...
What is happening when you update the managed object, the change notification , And to find out what the object was, so that it could tell its representative that the object was updated. To do this, it is running through all the batch till it can not be corrected. I am not sure why this information can not be cached, but clearly it is not. Have you tried adding a section cache to the Faxed Results Controller? This can potentially accelerate things (depending on whether the result received by the controller uses that cache in this example) you -initWithFetchRequest: managedObjectContext: sectionNameKeyPath: cacheName:
.
Comments
Post a Comment