I recommend watching videos with master data performance from the last few WWDCs. They often talk about strategies for improving such bottlenecks. Some suggestions from the video:
- De-normalize the name field to a separate "case and diacritic lensitive"
searchString and search in this field using < , <= or BEGINSWITH . Avoid MATCHES and wildcards. - Limit the number of results returned by
NSFetchRequest using fetchLimit and fetchBatchSize - If your companyβs object is large, you can extract some of the key data elements to a separate smaller object that is used only for the search interface. Then add a relation to the main object when the user makes a choice.
Some pointers to a couple of videos (there are other years):
WWDC 2012: Session 214 - Best Practices for Basic Data: 45:00
WWDC 2010: Session 137 - Optimizing Master Data Performance on iPhone OS: 34:00
source share