Post

Replies

Boosts

Views

Activity

Reply to Fetching data with relationships directly faults the relationships even when not accessed
Thanks for the replay. I did not create a feedback report yet but will create one. For now we moved away from relationships as this was having a big performance impact with our quite large data set. Instead our entities only store IDs of related entities. This prevents any loading of all the related entities, but adds a bit of manual work to handle the lazy loading.
Aug ’25
Reply to Fetching data with relationships directly faults the relationships even when not accessed
Just as an additional information even adding 'propertiesToFetch' to the fetchDescriptor makes no difference var fetchDescriptor = FetchDescriptor<OrganizationData>() fetchDescriptor.propertiesToFetch = [\.id] let organizations = (try? modelContainer.mainContext.fetch(fetchDescriptor))
Replies
Boosts
Views
Activity
May ’25
Reply to Fetching data with relationships directly faults the relationships even when not accessed
Some feedback would be appreciated. I also created a simple test app that reproduces this issue.
Replies
Boosts
Views
Activity
May ’25
Reply to Fetching data with relationships directly faults the relationships even when not accessed
Here is a simple test project: https://github.com/GNiewoehner/swiftdata-test-app On start it creates some dummy data, and fetches them without accessing any relationships. The logs are printed to the console.
Replies
Boosts
Views
Activity
May ’25
Reply to Fetching data with relationships directly faults the relationships even when not accessed
@DTS Engineer Do you have any update regarding the issue?
Replies
Boosts
Views
Activity
May ’25
Reply to Fetching data with relationships directly faults the relationships even when not accessed
Any update?
Replies
Boosts
Views
Activity
Jun ’25
Reply to Fetching data with relationships directly faults the relationships even when not accessed
@DTS Engineer This is still an issue. For now we stopped using relationships. Instead we store IDs and load entities lazy when accessed.
Replies
Boosts
Views
Activity
Jul ’25
Reply to Fetching data with relationships directly faults the relationships even when not accessed
Thanks for the replay. I did not create a feedback report yet but will create one. For now we moved away from relationships as this was having a big performance impact with our quite large data set. Instead our entities only store IDs of related entities. This prevents any loading of all the related entities, but adds a bit of manual work to handle the lazy loading.
Replies
Boosts
Views
Activity
Aug ’25
Reply to Fetching data with relationships directly faults the relationships even when not accessed
Interesting thanks for that. If that is the case the log is indeed misleading and their might be something else that caused the performance issues we had with relationships. As we currently see a significant improvement compared to our initial implementation.
Replies
Boosts
Views
Activity
Aug ’25