什么是CoreData模型中的获取索引元素?

在我的xcdatamodel中,两个新字段byTitleIndexcompoundIndex显示在Fetch Index Elements下。 我以前在Xcode中没见过这个部分。 什么是获取索引元素?

Xcode xcdatamodel突出显示compoundIndex字段的屏幕截图

获取索引元素是2017年WWDC上宣布的Apple新索引API的一部分。它们允许您指定一个或多个索引元素; 用于为更快的数据库搜索创建索引的属性。 在您的情况下,“title”属性将用于在“Passage”实体下创建名为“compoundIndex”的索引,从而允许更快的标题搜索。

公告: https : //developer.apple.com/videos/play/wwdc2017/210/?time = 628

演示: https : //developer.apple.com/videos/play/wwdc2017/210/?time = 997

文档(向下滚动到“使用索引”): https : //developer.apple.com/documentation/coredata/nsmanagedobjectmodel