If you only need a count, don't fetch all the objects just to call .count on the...
Paul Hudson @twostraws@mastodon.social
If you only need a count, don't fetch all the objects just to call .count on the result. fetchCount() does the work entirely in the database and is dramatically faster. https://www.hackingwithswift.com/quick-start/swiftdata/how-to-count-results-without-loading-them