Summarizing my experience with Enterprise Objects (from which the main data came from), I would say that both of your scripts will be equally fast without indexing, and the second one will be slightly slower with indexing.
Using and storing SQL, the cost of adding one object is largely fixed regardless of how many other objects are on the chart. Indexing does have a scaling effect because the index depends on other existing objects. However, in the vast majority of cases this does not matter.
The more complex the relationships inside the graph, the more it saves the effect of the overall size of the graph. Obviously, if you have a graph with only ten objects, then no relationship can contain more than ten objects. If you have 10,000, the relationship is potentially much larger and takes longer to process.
In general, Core Data with SQL repository seems to be largely independent of graph size.
Techzen
source share