开发者

What is a reason NOT to make a Core Data property indexed?

What is a reason NOT to make a Core Data property indexed? From what I understand, searchable properties are supposed to be indexed, if it helps performance. If so, why isn't everything automatically indexed "internally"? Why must I 开发者_运维技巧turn it on/off for applicable properties, and what is the reason not to index a property? If it's not automatically applied to everything, there must be a reason. What might that be?


Indexes aren't free. Each additional index will increase the size of the Core Data store somewhat, as well as making it take slightly longer to save entities. So, if an index on a given property will never be used, or if it's used rarely enough that the performance bonus from having it indexed isn't significant, performance (and storage usage) will actually be better overall without the index.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜