SetFetchBatchSize is not working properly

I ask a few questions on this topic, but still can not get it to work. I have basic data with 10k + rows names that I show in a table. I would like to be able to search and update a table with each letter. These are very lags. As suggested, I am watching WWWDC '10 master data presentation and trying to implement

[request setFetchBatchSize:50];

It doesn't seem to work. When I use the tools for checking the master data, it still shows that there is another 10k query when loading the tableview, and when I look for it, it also gets all the results. Is there anything else that needs to be done to set the batch size or is this not what will help me.

The only thing that seems to work is to set the fetchlimit value to 100 when searching. Do you think this is a good solution?

Thanks in advance!

+3
source share
1 answer

Lot size simply indicates how many objects need to be taken at a time. Most likely, this will not help you. Let's look at your use case a little ...

The user enters “F” and you specify the database: “Go find all the names starting with“ F ”and the database looks through all 10k + entries to find those starting with“ F ”

Then the user enters “r”, so you tell the database to find all records starting with “Fr” and look again at all 10k + records to find those starting with “Fr.”

, fetchBatchSize, : ", , 50 , ". , .

fetchLimit 100 , 10k +, , 100 , , . , 100 , .

, , , .

, . Xcode (, , , ). , .

-, , "F", , , "Fr". "Fr ' ' F ', NSManagedObject . , .

, , . , . , , .

, , , .

, , , . , . .

, , . CoreData , .

,

, SQLLite , B-Tree logBN, 30 . . , .

, . . fetchBatchSize , .

countFetchRequext executeFetchRequest, . fetchLimit , .

... , , .

, ... ? - (, ), .

, , - , , . . .

, - - ...

+12

All Articles