开发者

CoreData Performance and Field Autocomplete

I have this remote database of artists. About 6,000 entries for now. I want my app to:

  1. download a JSON-formatted index of the artist names (~95kb)
  2. import that data to CoreDa开发者_如何学Gota
  3. provide suggestions/auto-complete when the user adds a new artist

I've done this before, but not on such a big scale. Will it become problematic when the database reaches 20 or 30 thousand entries? I'm not worried about the JSON filesize but mostly about CoreData's ability to quickly fetch data using an NSPredicate such as artist_name LIKE textField.text every time the textField changes value.


At the very least, make sure you mark artist_name as indexed... that should help.

I'd also investigate other predicates and see if there's not a substring specific one that might perform better than LIKE.

You'll also want to look into pre-loading a database that holds that much data, and update it in the background... a 300k JSON file will take a LONG time to download if the network is at all poor.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜