My database has over 100k entries and anytime I access it either via @Query or a custom Fetch request it freezes my apps UI for 10+ second.
My first question is anyone having performance issues with large data sets. If so how have you found to resolve it ?
My next question is does swiftUI load the entire database into memory with the @Query. As I feel it is seeing as my app becomes very slow and partially unresponsive.
lastly if I have 2 data models and 1 has a to many relationship to the other are both loaded into memory even though only @Query 1?
consider datamodels
model1 {
var name : String
@Relationship(deleteRule:.cascade) var lotsOfData :[LotsOfData]
init....
}
LotsOfData{
var element1 : String
var element2 : String
var element3 : String
var element4 : String
var element4 : String
init ….
}
LotsOfData has 100K instances in the database.
if I @Query into model1 because it references LotsOfData through A relationship is all that data all called / loaded ?
thanks for the information